Commit graph

340 commits

Author SHA1 Message Date
Andrew Cholakian
eac230f122 Fix race condition in shutdown of pipelines
Prior to this a single worker could slurp down multiple shutdown messages, this prevents that from happening by using a flag that can't be overconsumed.

Fixes #9285
2018-03-26 21:59:18 +00:00
Armin
d4821dd398 MINOR: Remove unnecessary logger fields from output delegator strategy and plugin factory
Fixes #8964
2018-01-17 11:38:07 +00:00
Armin
6d1dd96847 JAVAFICATION: Move remaining Logstash::Timestamp Ruby Code to Java
Fixes #8969
2018-01-17 11:27:15 +00:00
Armin
33ece13ef2 MINOR: Remove unnecessary logger fields from filter and output delegators
Fixes #8957
2018-01-16 22:02:48 +00:00
Armin
d0d3b9f3af MINOR: Fixed Iteration Order per Batch Worker Thread
Fixes #8928
2018-01-13 12:18:30 +00:00
Jake Landis
233b805a82 Secret Store: Ability to set and use secret data from an encrypted data store.
Fixes #8657

Part 1: API and JavaKeyStore implementation (#8657)

Introduces the API to read/write/delete sensitive data from a secure store and includes a Java KeyStore implementation. Note - this commit does NOT integrate with the Logstash configuration or settings.

Part 2: Secret Store: SecretStoreFactory, SecureConfig, Obfuscation and X-JVM support (#8659)

*  Secret Store: SecretStoreFactory, SecureConfig, Obfuscation and X-JVM support

* Introduce a SecretStoreFactory to allow runtime definition of SecretStore implementation.
* Introduce a SecureConfig to allow simple configuration of different SecretStore implementaiton.
* Introduce random default password plus obfuscation. Best attempt at security through obscurity.
* Corrections / better support for x-JVM modification.

Part 3: Secret Store: SecretStore, SecretStoreFactory, JavaKeystore - refacactor (#8745)

* Adds more CRUD like operations for SecretStore API
* SecretStoreFactory Mirror API's CRUD operations
* Adds 'exists' to API to allow command line warning 'Overwrite ?'
* Minor readabiliy

Part 4: Integrate secret store with Logstash core (#8905)

This change introduces the command line tooling and hooks needed to allow Logstash to use the secret store. This change hooks into the same logic that the does the environment variable substitution. The commnad line mirrors the Elasticsearch command line, and is implemented primarily in Java.

Part 5: Hardening and test fixes (this PR)

Fixes #8935
2018-01-13 01:24:33 +00:00
Armin
a84846d293 #8619 Fix periodic flusher in Java exec + spec
Fixes #8629
2018-01-05 17:49:27 +00:00
Armin
f5aaf8a93e #8883 Fix concurrent modification issue on RubyArray in mock output
Fixes #8884
2017-12-26 10:07:15 +00:00
Armin
9fe13d1e60 Config Compiler Enhancement
* Compile conditional datasets
* Correctly typecast Dataset implementations in generated code using a custom ClassLoader
* Optimize away redundant calls to get the current Ruby thread context
* Make field naming and typing in generated code automatic
* Modularize code a lot more
* Fix and spec for #8757
   * Fixed by caching the result of a filter Dataset correctly, it was missing the boolean flag that triggered just returning the internal cache

Fixes #8691
2017-12-22 18:18:57 +00:00
Andrew Cholakian
8e7fb93d16 Simple vertex hashing
Fixes #8836

Fixes #8863
2017-12-20 02:19:40 +00:00
Andrew Cholakian
f5730da284 Validate deprecated/obsolete options after sanitization
The old order made no sense since Password / SafeURI objects were not wrapped in their to_s suppressing containers.

Only remove the obsolete params after they've been detected

Fixes #8785
2017-12-12 14:23:21 +00:00
Jake Landis
7fddc4a5de LIR: merge arrays of divergent types
Specifically this change explictly checks for the Array type to merge into and pushes into the array instead of relying only on the + concat.

Fixes #8827

Fixes #8831
2017-12-11 23:33:10 +00:00
Colin Surprenant
078f9f11b0 change batch delay to 50ms and page size to 64mb
a 50ms delay helps creating more full batches without practical added latency see #8707
a 64mb page helps PQ perfmance related to a large page size see #8702 #8707
2017-12-05 13:59:14 -05:00
Ry Biesemeyer
745946d2c5 LSCL/LIR: enable plugins to have nested hash directives
A regression was introduced in the new LSCL/LIR implementation in 6.0, in
which configurations that had nested hashes produced valid treetop-ASTs that
could not produce a valid LIR; the values in an `LSCL::AST::Hash` were
assumed to implement `ValueExpression`, but `LSCL::AST::Hash#expr` produced
an unwrapped `RubyHash`.

By making `LSCL::AST::Hash#expr` emit a `ValueExpression` _representing_ a
`RubyHash`, and relying on the existing code that deals with `ValueExpression`
appropriately, we can re-enable deeply-nested hashes in configs.

Resolves: elastic/logstash#8701
Resolves: logstash-plugins/logstash-output-http#77
Resolves: sw-jung/logstash-filter-memoize#1

Fixes #8750
2017-11-28 19:11:50 +00:00
Armin
bccc0d9a39 #8728 Fix RubyTimestamp's '<=>' implementation to correctly compare to other types
Fixes #8730
2017-11-27 16:38:43 +00:00
Jake Landis
c7531647ff Minor: Rename environment variables to substitution variables
This is in support of a future change to also support substitution from the secret store in addition to the environment variables.

Part of #8353

Fixes #8699
2017-11-21 14:17:13 +00:00
Armin
125ef10f2c MINOR: Remove dead code from wrapped in-memory-queue
Fixes #8644
2017-11-13 10:47:46 +00:00
Ry Biesemeyer
db5085754d LIR: merge hash attributes of same name to support legacy configurations
A [build failure][] of the grok plugin when run through LIR/lscl indicates that
there is an expectation for multiple Attributes of the same name to be merged
together.

This commit ports the failing spec in the plugin to an abstraction that can be
tested within logstash-core, and adds a caveat to the LSCL LIR-builder to
ensure that we merge the hashes in a way that is compatible with legacy
behaviour.

NOTE: when multiple Attributes of the same name are used in a single config,
it's possible to create configurations that circumvent `AST::Hash`'s ability to
report duplicate keys.

[build failure]: 293778268

Fixes #8597
2017-11-07 21:51:29 +00:00
Armin
63dc6b8e34 MINOR: Cleanup Java Test Code in Production Classpath
Fixes #8592
2017-11-06 15:30:25 +00:00
Armin
59d783dd47 Java Pipeline Compiler
Fixes #8569
2017-11-02 17:43:51 +00:00
Guy Boertje
8d11217ea4 Fix 'https' scheme in ES hosts setting when set from Cloud ID. (#8492)
* fix 'https' scheme in ES hosts setting

* Fixes as per review
2017-10-24 19:18:46 +01:00
Armin
f27f949e06 MINOR: Remove dead code supporting non-java platforms
Fixes #8513
2017-10-23 18:02:03 +00:00
Rob Bavey
fc844b2b71 Modules: Set default credentials for Kibana if es info is present
If modules configuration has elasticsearch credentials set, but not
kibana, attempt to use elasticsearch credentials for Kibana login.

Fixes #8422

Fixes #8482
2017-10-13 17:04:50 +00:00
Armin
a0e0ef7861 PERFORMANCE: Avoid redundant (and high overhead) size calls to Java HashMap
Fixes #8448
2017-10-13 12:19:02 +00:00
Tamara Braun
a90f56a39c #8343 return 400 on broken url
Fixes #8471
2017-10-11 21:07:19 +00:00
Armin
67347529f4 PERFORMANCE: Simplify batch iteration
Fixes #8443
2017-10-10 16:44:02 +00:00
Armin
acad8babec BUG: Fix filter_func logging for config.debug=true
Fixes #8456
2017-10-09 13:07:03 +00:00
Armin
4b8043c5cd PERFORMANCE: LIR Pipeline Execution
Fixes #8357
2017-10-05 20:37:26 +00:00
Armin
179eaff57e PERFORMANCE: filter_func can optionally take an array of events to make batched filters much faster
Fixes #8428
2017-10-05 19:32:47 +00:00
liketic
f6d3903f63 Update description for registry remove test
Fixes #8378
2017-09-26 18:14:01 +00:00
liketic
1231d72823 Add remove method for LogStash::PLUGIN_REGISTRY
Fixes #8378
2017-09-26 18:14:01 +00:00
Pier-Hugues Pellerin
2bdd6ec1ef Correctly Serialize RubyNil values when serializing to JSON
The custom serializer introduced in #8371 did change the behavior or JSON
serialization when one of the field was a RubyNil values.

The orignal behavior was to serialize RubyNil values into their
Javascript Null. The PR #8371 changed that behavior to instead
serialized an empty string and changed the expected type.

This commit revert the behavior to serialize to Null and also tests
around the events class to prevent that.

Fixes #8386
2017-09-26 15:35:14 +00:00
Jake Landis
129519df67 Test fixes: This should fix a couple different test failures.
* Fixes #8344 - Ruby Unit Test can hang with no information as to why
* Fixes #7227 - MetricStore::MetricNotFound
* Fixes #8204 - `config.reload.automatic` is set to`FALSE

I am only certain it fixes #8344 and #7227, since I can not reproduce #8204.

Fixes #8376
2017-09-24 03:39:29 +00:00
Armin
cdfd1d056a #8341 raise tolerance in timestamp_spec.rb tests
Fixes #8342
2017-09-20 17:20:14 +00:00
Pier-Hugues Pellerin
0b0395622c Remove tests dependency on filter multiline
Some of the test were still depending on the multiline filter, this
filter is now shipped anymore with Logstash. I've keep the same logic
but created a simple dummy filter.

Fixes #8284
2017-09-18 13:24:40 +00:00
Armin
91b5128338 #4640 make Event#clone clone metadata as well
Fixes #8291
2017-09-18 12:54:39 +00:00
Rob Bavey
822e281429 Fix double password wrap
Password settings for Modules supplied via a yml file were being wrapped inside a
LogStash::Utils::Password object twice during startup - once in from_yaml, and once
in validate. Disallow this from happening by skipping the wrap if the password is
already wrapped

This should complete the fix for #8224

Fixes #8258
2017-09-14 22:12:45 +00:00
Rob Bavey
ef431bd8f7 Fix failing scaffold test
Fix failing scaffold test by wrapping module settings with
ModuleSettingsArray, as happens when running Logstash

Fixes #8226
2017-09-13 17:57:11 +00:00
Rob Bavey
70844f02d3 Fix password support for Modules
Module settings should use value field for setting password in
Elasticsearch output config, not the implicit, obfuscated to_s value.

Fixes #8226
2017-09-13 17:57:11 +00:00
Armin
89af438309 PERFORMANCE: Flatten logic for write batch instantiation
Fixes #8163
2017-09-11 09:48:43 +00:00
Armin
d82ba45d90 #8148 properly join threads in webserver_spec
Fixes #8150
2017-09-07 07:03:40 +00:00
Armin
d66e0c507c PERFORMANCE: Move Memory Queue push loop into Java
Fixes #8140
2017-09-06 15:51:38 +00:00
Guy Boertje
dde2730d10 Really fix verbose logging in tests
Fixes #8117
2017-09-01 05:54:16 +00:00
Colin Surprenant
f5480128f7 post backport fix of windows fixes for missing timeout 2017-08-31 20:39:55 -04:00
Colin Surprenant
d382248caf fixes for Windows platform tests/specs
use rm_rf to delete dir and shutdown pipeline after run

avoid the use of rescue nil, bad practice

do not mock close as it prevents closing the file an prevents removing it on Windows

cleanup temporary files and relax file name check for Windows

fix paths handling for Windows

flag the read file string as UTF-8 which is what we expect

fix Windows issues

ignore load_average on windows

windows safe URI

cleanup and fix file handling for windows

wait for pipeline shutdown to complete

revert to original puts

cleanups

use environment for windows platform check

fix hash path

wait for pipeline thread to complete after shutdown
2017-08-31 20:35:52 -04:00
Guy Boertje
e2b2e7d979 Modules cloud id auth (#8059)
* add newlines to generated json

* Implement cloud.id and cloud.auth settings merge to module settings

* Fixes from review plus convert to using Password for any Module Setting

* Review changes

* update modules.asciidoc to include a section on Cloud

* Capitalize Id

* remove unnecessesary require lines
2017-08-28 08:51:21 -07:00
Rob Bavey
ccb3b7978f Fix DLQ support for multi-pipelines
Add missing settings to the multi-pipeline settings white list to
allow DLQ to be used with multi-pipelines

Fixes #8069

Fixes #8076
2017-08-25 20:34:19 +00:00
Colin Surprenant
b50bcd17e0 relax time gap constrain in expectation 2017-08-25 13:13:27 -04:00
Andrew Cholakian
9449b1909a Use rspec wait to fix flakey converge specs
Some converge specs have races, assuming that a running Agent means that pipelines have started running.
This patch lets us wait a while in the event of a race. One such failure is here: https://logstash-ci.elastic.co/job/elastic+logstash+master+multijob-unix-compatibility/os=centos/72/console

Additionally, this removes a harmless double invocation in these specs

Fixes #7912
2017-08-23 21:56:48 +00:00
Armin
1066d61dae #8016 remove Max bucket setting from specs to bring them in line with #8010
Fixes #8017
2017-08-17 15:07:15 +00:00