Commit graph

539 commits

Author SHA1 Message Date
Armin
4644ece0b6 JAVAFICATION: Move remaining Logstash::Timestamp Ruby Code to Java
Fixes #8969
2018-01-17 11:27:15 +00:00
Armin
0aa609c9ff MINOR: Remove unnecessary logger fields from filter and output delegators
Fixes #8957
2018-01-16 22:02:48 +00:00
Armin
644f536101 MINOR: Fixed Iteration Order per Batch Worker Thread
Fixes #8928
2018-01-13 12:18:30 +00:00
Jake Landis
058c9a6c47 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:22:53 +00:00
Armin
76c24cf697 #8619 Fix periodic flusher in Java exec + spec
Fixes #8629
2018-01-05 17:49:27 +00:00
Armin
eca52ed6b9 #8883 Fix concurrent modification issue on RubyArray in mock output
Fixes #8884
2017-12-26 10:07:14 +00:00
Armin
fc6d8a43e9 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
cf4de7ae23 Simple vertex hashing
Fixes #8836
2017-12-20 01:50:19 +00:00
Andrew Cholakian
a0aa92980e 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
703dfca10e 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
40827a53eb 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:51:54 -05:00
Ry Biesemeyer
ce91c99c48 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
9efb221837 #8728 Fix RubyTimestamp's '<=>' implementation to correctly compare to other types
Fixes #8730
2017-11-27 16:38:43 +00:00
Jake Landis
dc24a87c03 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
99a36fe5f8 #8623 make Java execution the default
Fixes #8649
2017-11-13 19:12:39 +00:00
Armin
0b8a0bdbdd MINOR: Remove dead code from wrapped in-memory-queue
Fixes #8644
2017-11-13 10:47:45 +00:00
Ry Biesemeyer
148ffd31f2 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:48:40 +00:00
Armin
acd8d41337 MINOR: Cleanup Java Test Code in Production Classpath
Fixes #8592
2017-11-06 15:30:25 +00:00
Armin
bd99fc36ea Java Pipeline Compiler
Fixes #8569
2017-11-02 17:43:51 +00:00
Guy Boertje
4397b2d745 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:02:15 +01:00
Armin
3f5007c2ee MINOR: Remove dead code supporting non-java platforms
Fixes #8513
2017-10-23 18:02:03 +00:00
Rob Bavey
a03982f83b 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:49 +00:00
Armin
b062da4912 PERFORMANCE: Avoid redundant (and high overhead) size calls to Java HashMap
Fixes #8448
2017-10-13 12:19:01 +00:00
Tamara Braun
3233d63da5 #8343 return 400 on broken url
Fixes #8471
2017-10-11 21:07:20 +00:00
Armin
7decf43483 PERFORMANCE: Simplify batch iteration
Fixes #8443
2017-10-10 16:44:02 +00:00
Armin
b5062e7c18 BUG: Fix filter_func logging for config.debug=true
Fixes #8456
2017-10-09 13:07:03 +00:00
Armin
982c44bc1f PERFORMANCE: LIR Pipeline Execution
Fixes #8357
2017-10-05 20:37:25 +00:00
Armin
116ed1d540 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
0179bfce2c Update description for registry remove test
Fixes #8378
2017-09-26 18:14:01 +00:00
liketic
fa38f9f7c6 Add remove method for LogStash::PLUGIN_REGISTRY
Fixes #8378
2017-09-26 18:14:00 +00:00
Pier-Hugues Pellerin
6c2edd1ccc 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:13 +00:00
Jake Landis
d2011f9185 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
bb91ae69c5 #8341 raise tolerance in timestamp_spec.rb tests
Fixes #8342
2017-09-20 17:20:13 +00:00
Pier-Hugues Pellerin
8de867b173 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
a0bf5f78f0 #4640 make Event#clone clone metadata as well
Fixes #8291
2017-09-18 12:54:38 +00:00
Rob Bavey
f5092292ea 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
b4ad928532 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
57484fc799 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
2514c6b801 PERFORMANCE: Flatten logic for write batch instantiation
Fixes #8163
2017-09-11 09:48:43 +00:00
Armin
d8462f0508 #8148 properly join threads in webserver_spec
Fixes #8150
2017-09-07 07:03:40 +00:00
Armin
5d71a2b2b6 PERFORMANCE: Move Memory Queue push loop into Java
Fixes #8140
2017-09-06 15:51:38 +00:00
Guy Boertje
3ce46f5473 Really fix verbose logging in tests
Fixes #8117
2017-09-01 05:54:16 +00:00
Colin Surprenant
21dbde2567 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 19:42:49 -04:00
Guy Boertje
c5f56e84d8 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:46:02 -07:00
Rob Bavey
75028f3592 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
f64762fd05 relax time gap constrain in expectation 2017-08-25 13:11:38 -04:00
Andrew Cholakian
3b26440131 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
4387c959b0 #8016 remove Max bucket setting from specs to bring them in line with #8010
Fixes #8017
2017-08-17 15:07:14 +00:00
Joao Duarte
e28ceeb8e5 prevent tests from changing config.debug flag
Fixes #7962
2017-08-10 08:13:31 +00:00
Aaron Mildenstein
fb7f455f1c Add --setup phase for modules (#7965)
* Add --setup phase for modules

Without the `--setup` flag, the index template for elasticsearch, and the index-pattern, saved searches, visualizations, and dashboards for Kibana will not be published.

fixes #7959
2017-08-09 16:50:56 -06:00