during startup signal trapping is set up to gracefully shutdown logstash
this signal handling relies on Stud.stop? which depends on @thread being set
Currently we set that variable after setting up the trapping, which
creates a window where an interruption will trigger Stud.stop and find
@thread to be nil.
This patch moves the setting of @thread to be done before trapping, this
fixing the issue.
Fixes#5829
This is a backport of https://github.com/elastic/logstash/pull/5752 to
the 2.x branch targetting the 2.4 release.
The changes here are more minimal since the pipeline code is simpler and we need to support
some other legacy constructs such as the instance level version of Outputs::Base#workers_not_supported.
This is a deviation from what the ruby URI class normally allows.
With this patch users can use "myhost:123" as an option and have it do the
right thing, as opposed to before where they'd get an error and have to
use "//myhost:123".
Fixes#5618
* bump logstash-core/logstash-core-event/logstash-core-event-java to 2.4.0.dev
* bump logstash-core-plugin-api to 1.21.0
* provides both get/set and []/[]= events apis by allowing to be installed in logstash >= 2.4 and < 3
* minor bumps on gem dependencies
Fixes#5601
This PR, backport the `NullMetric` class from the master branch into the
2.X series and allow to write plugin that can be run on both Logstash 5
and Logstash 2.X without changing the code and without having to check
if the metric object is set before capturing a metric.
Fixes: #5539Fixes#5544
If set to try this will allow the user to specify one or more values.
This generally replaces the :array type, which had fewer type checks.
The array type is still needed for lists of complex objects, e.g. hashes.
Fixes#5499
Often times plugins (like the Elasticsearch output) can naturally use URIs for their configuration.
Unfortunately using the :string type here means that the password portion of the URI can easily be leaked.
This wraps the URI class in a new LogStash::Util::SafeURI class that proxies all regular URI methods but masks
the password when `#to_s` and `#inspect` are invoked.
Fixes#5470
* avoid class variable during pipeline compilation
* avoid creating pipeline if fetched config is the same as previous
* reduce overhead of create_pipeline if config is known
* use closure table instead of ivars
* avoid dynamic use of singleton methods in pipeline compilation
* adapt config_ast test to support lack of ivars
This is made available by a --log-in-json flag. Default is false.
When false, the old behavior [1] is used.
When true, JSON logs are emitted.
[1] The old behavior is realy two things. First, using Object#inspect to
serialize. Second, to color the output if the IO is a tty.
For #1569
This is a manual backport of PR #4820 into the 2.x branch.
Fixes#5277
We now hide this because displaying it is dangerous. Generated code
and other AST data may contain plaintext copies of 'password' type fields.
Users can force this to appear with the --debug-config flag.
Fixes https://github.com/elastic/logstash/issues/4964Fixes#4987
The move to auto-scale output workers was great in theory, but a lot of outputs
just weren't built to support it well, they often used too many resources or had
logical errors.
Fixes#4905