Commit graph

835 commits

Author SHA1 Message Date
Armin
7cea457eef CLEANUP: Dry up filter wrapper setup
Fixes #9337
2018-04-08 16:49:56 +00:00
Joao Duarte
d035f18b3c fix typo in pipeline startup message
Fixes #9330
2018-04-05 15:28:44 +00:00
Armin
08a02a390a #9296: Nested Metadata field lookup in config compiler fixed
Fixes #9297
2018-03-28 12:06:21 +00:00
Andrew Cholakian
cc72641447 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 17:01:34 -05:00
Armin
8b89a139a6 BUG: Fix Java execution not handling nil return from flush invocations
Fixes #9289
2018-03-26 14:47:17 +00:00
Ry Biesemeyer
0c12ea9a7f fix crash during exit when reporting on already-reaped thread
Although `LogStash::JavaBasePipeline#plugin_threads_info` attempts to only report on
living threads, it is possible for a thread to die/complete after the check and before
we attempt to extract status in `LogStash::Util#thread_info`; since `Thread#backtrace`
can return `nil` when the thread is no longer living, this causes a crash.

By falling back to an empty array when the backtrace cannot be ascertained from the
given thread, we can emit a thread status even if the thread has already completed.

Fixes #9097
2018-03-24 08:09:45 +00:00
Guy Boertje
daeb4f4071
Fix: Tags collision with user-defined tags and built-in tags (#9166)
* return early if there's no remove_tag work todo.

* add spec to prevent regression

* fix typo as per review
2018-03-20 16:50:57 +13:00
Joao Duarte
b0d1caeb6e tolerate different types for ssl.enabled module options
Fixes #8600
2018-03-19 15:34:15 +00:00
Andrew Cholakian
e71ad41022 Better logging info for intermittent source related CI failures
As seen in https://logstash-ci.elastic.co/job/elastic+logstash+pull-request+multijob-ruby-unit-tests/111/consoleFull
sometimes specs fail due to this failing invariant.

The exact error was:

```
[ERROR] 2018-03-14 23:26:12.985 [[main]-pipeline-manager] agent - An exception happened when converging configuration {:exception=>LogStash::InvalidSourceLoaderSettingError, :message=>"Can't find an appropriate config loader with current settings", :backtrace=>["/opt/logstash/logstash-core/lib/logstash/config/source_loader.rb:55:in `fetch'", "/opt/logstash/logstash-core/lib/logstash/agent.rb:148:in `converge_state_and_update'", "/opt/logstash/logstash-core/lib/logstash/agent.rb:90:in `execute'", "/opt/logstash/logstash-core/spec/support/shared_contexts.rb:26:in `block in (root)'", "org/jruby/RubyBasicObject.java:1728:in `instance_exec'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:350:in `run'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:509:in `block in run_owned_hooks_for'", "org/jruby/RubyArray.java:1734:in `each'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:508:in `run_owned_hooks_for'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/hooks.rb:460:in `run'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:537:in `block in run_before_context_hooks'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/memoized_helpers.rb:186:in `block in isolate_for_context_hook'", "org/jruby/RubyBasicObject.java:1728:in `instance_exec'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/memoized_helpers.rb:182:in `isolate_for_context_hook'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:536:in `run_before_context_hooks'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/example_group.rb:589:in `run'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:118:in `block in run_specs'", "org/jruby/RubyArray.java:2486:in `map'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:118:in `block in run_specs'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/configuration.rb:1926:in `with_suite_hooks'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:113:in `block in run_specs'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/reporter.rb:79:in `report'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:112:in `run_specs'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:87:in `run'", "/tmp/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.7.1/lib/rspec/core/runner.rb:71:in `run'", "/opt/logstash/lib/bootstrap/rspec.rb:13:in `<main>'"]}
```

I think more detail here would be useful, hence the additional log line. Hopefully if/when this happens again we'll have enough to actually debug it.

Fixes #9243
2018-03-16 17:06:16 +00:00
Andrew Cholakian
56da43e52a Load x-pack automatically when located in a subdirectory
This is in preparation for our opening of x-pack https://www.elastic.co/products/x-pack/open .

X-Pack can be disabled by setting the environment variable OSS=true, or by removing the X-Pack folder.

Fixes #9222
2018-03-09 19:16:32 +00:00
Dan Hermann
0b83d4fc86 JAVAFICATION: Eliminate ruby calls in worker loop
Fixes #9178
2018-02-21 14:50:38 +00:00
Dan Hermann
f024216db8
Common read clients and batches (#9111) 2018-02-15 10:05:32 -06:00
Rob Bavey
4532864776 Fix PQ stats with ruby pipeline
Stats were not being collected when the PQ was enabled due to the
queue class type check not being updated after Javafication of
WrappedAckedQueue

Fixes https://github.com/elastic/x-pack-logstash/issues/335

Fixes #9116
2018-02-08 16:59:07 +00:00
Dan Hermann
43ff4ba19f JAVAFICATION: Java wrapped acked queue
Fixes #9080
2018-02-07 16:06:37 +00:00
Armin
89a9616705 JAVAFICATION: Use Longadder instead of Ruby Concurrent AtomicLong for pipeline counters
Fixes #9067
2018-01-30 15:31:48 +00:00
Armin
0fc9c1f342 JAVAFICATION: Java acked read client
Fixes #9056
2018-01-30 08:38:41 +00:00
Armin
64bcbfb136 JAVAFICATION: Move AckedQueue Read Batch to Java
Fixes #9028
2018-01-29 13:55:48 +00:00
Armin
b30252fb19 BUG: Memory Queue needs to always be drained
Fixes #9024
2018-01-25 21:41:31 +00:00
Armin
eeb3e122b0 MINOR: Remove unused method in java pipeline
Fixes #9025
2018-01-24 18:44:29 +00:00
Colin Surprenant
da15c5b3b7 verify available disk space for PQ #8978. This code was originally written by @original-brownbear for #6998
localize error message

refactor & simplify hasFreeSpace() per @yaauie suggestion

reformat for clarity
2018-01-24 10:51:41 -05:00
Armin
4ada6dbf4d JAVAFICATION: Java write client for acked queue
Fixes #9013
2018-01-24 09:58:57 +00:00
Armin
2026b071da JAVAFICATION: Move flusher thread to Java
Fixes #9016
2018-01-23 18:24:29 +00:00
Armin
28e7467f9f Remove in memory serialized queue Ruby wrappers
Fixes #8999
2018-01-22 23:22:15 +00:00
Armin
28a2d1d48d MINOR: Align behaviour of acked queue Ruby wrappers with behaviour of in memory queue wrappers
Fixes #9003
2018-01-22 20:19:49 +00:00
Armin
9bca2bf303 MINOR: Remove dead field and imports from java pipeline
Fixes #9001
2018-01-22 16:56:21 +00:00
Armin
33cf07766b MINOR: Remove two dead methods from Acked queue
Fixes #9000
2018-01-22 16:51:36 +00:00
Dan Hermann
dee283a270 JAVAFICATION: Port remainder of synchronous queue to Java (#8991)
* JAVAFICATION: Port WrappedSynchronousQueue.WriteClient and WrappedSynchronousQueue to Java
2018-01-22 10:24:32 +01:00
Armin
ba0a4ee075 JAVAFICATION: Move pipeline worker loop to Java
Fixes #8988
2018-01-19 14:41:49 +00:00
Dan Hermann
d7cd3b29cc JAVAFICATION: Port memory queue read client to Java. Also uses Java counters more efficiently per #8985. Rough throughput testing with generator input shows 15-20% increase due mainly to the metrics improvements.
Fixes #8987
2018-01-19 14:11:18 +00:00
Armin
2f7a5327ad MINOR: Simplify inflight batch tracking
Fixes #8948
2018-01-18 17:53:56 +00:00
Armin
edd8844670 JAVAFICATION: Port wrapped write client to Java
Fixes #8977
2018-01-18 13:10:32 +00:00
Armin
9bead1c93d MINOR: Remove unnecessary logger fields from output delegator strategy and plugin factory
Fixes #8964
2018-01-17 11:38:06 +00:00
Armin
879454af3b JAVAFICATION: Remove Ruby method_missing deprecation on Event
Fixes #8970
2018-01-17 11:28:49 +00:00
Armin
4644ece0b6 JAVAFICATION: Move remaining Logstash::Timestamp Ruby Code to Java
Fixes #8969
2018-01-17 11:27:15 +00:00
Armin
c77b6b5cbe JAVAFICATION: Move in memory queue read batch to Java
Fixes #8956
2018-01-17 09:27:34 +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
284366d01c CONFIG COMPILER: Logging to local source files
This reverts commit e5f359367f.

Fixes #8913
2018-01-16 16:48:22 +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
Colin Surprenant
67c12393ac correctly handle paths with spaces 2018-01-11 13:28:15 -05:00
Armin
76c24cf697 #8619 Fix periodic flusher in Java exec + spec
Fixes #8629
2018-01-05 17:49:27 +00:00
Armin
67e2ca354d MINOR: Remove pointless method form compiledPipeline
Fixes #8911
2018-01-04 17:35:45 +00:00
Armin
543b7221bd JAVA EntryPoint
* Created `org.logstash.Logstash` as entrypoint
* Safely handle `Ruby` runtime (which sadly is still a singleton, moving away from that will require a few iterations on top of this)
* Adjusted `bat` and `sh` entry point wrappers
* Verified manually that performance is unchanged (i.e. all Java opts are still loaded properly)
* Flattened `.jar` path to make it a little less bothersome to build the `-cp` string
* Retained ability to load jars from Ruby via the global `$LS_JARS_LOADED` variable hack, to keep plugin specs that load LS as a `.gem` functional (like e.g. the ITs in LS itself)
* No need for the gem jars magic anymore, the downloading and moving into place of jars is now all handled by Gradle

Fixes #8161
2018-01-03 19:13:28 +00:00
Jake Landis
e9ba86e3b6 Dataset compiler: add pretty print generated source output
Fixes #8691
2017-12-22 18:18:57 +00:00
Jordan Sissel
5786dcd47a Add tool to generate dependency details in csv
Fixes #8725

Rough goal is to present license information for all dependencies

Fixes #8881
2017-12-22 16:54:29 +00:00
Shaunak Kashyap
a3f6da3c3a Allow users to specify --pipeline.id from the CLI
This will allow users to override the pipeline id from the default, "main", to something else while running pipelines via either the -e or -f options.

Fixes #8868
2017-12-20 20:17:36 +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
Joao Duarte
e370407e52 fix require of manticore to avoid warnings at startup
Fixes #8835
2017-12-12 13:52:04 +00:00
Joao Duarte
a95bf6716e several improvements to logging messaging and ordering
* remove unused close_pipelines agent code

Fixes #7956
2017-12-12 13:08:10 +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