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#5453
Make sure we pass the metric when we create a pipeline this make sure
the metric is correctly visible in the pipeline and remove the need to
lock the variables.
Make the expectation more robust in the metric reload scenario.
Fixes#5400 for the greater good.
Fixes#5446
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#5439
Setting error handling conditions in sinatra dynamically is not possible.
The values such as :show_exceptions get set, but have no effect.
This is esp. important in testing where we want failures to raise exceptions.
Otherwise, debugging is a matter of parsing instructable HTML responses containing
the debug info.
We do not want this behavior by default however, as doing so would mean a single API
bug would take down a production app.
This change adds a new agent setting (not CLI setting) 'http.environment' that is defaulted to 'production'.
If set to 'test' exceptions get raised.
This change also removes sinatra error handlers that previously did nothing, and injects
custom rack middleware to properly log and handle errors.
Fixes#5411
This PR make sure that all the tests using the agent or the pipeline are
correctly shutting down their pipelines to make sure the metrics state
are coherent with the config defined in the test.
Fixes: #5291Fixes#5365
The `path.settings` requires the LOGSTASH_HOME constant to be defined,
the problem is that constant is only defined when you are actually
inside the logstash application, This was causing a bug when you were
testing plugin individually because that constant wasn't defined.
Fixes: #5361Fixes#5363
* by default lives in LOGSTASH_HOME/config/logstash.yml
* location can be changed by $LS_SETTINGS_DIR or --path.settings
* overrides defaults of LogStash::Environment, BUT
* CLI flags override the yaml file
* several breaking changes to cli flag names (see config/logstash.yml)
* setting values are now type checked (see Setting and Settings classes)
Fixes#5313
Use an internal subscriber to verify that JSON output is valid JSON. The
purpose is to catch any json serialization errors that would occur while
logging.
Also had to update a few logger calls to log values that could be
serialized (Class instances and similar, at this time, fail to serialize
to JSON).
Fixes#4820
This is made available by a new `--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.
Fixes#1569Fixes#4820
refactor wip gemfiles
refactor Java Event getter and setter
bump plugin-api to 2.0
use plugin-api 2.0
switch to core-event-java
include logstash-core-event-java.jar jar file so that gem dependency using the source tree work
updated core plugins to core-api 2.0
added grok for refactor branch
fix rebased specs
remove temp plugins github paths
remove commented out tmp alias_method
The Rack config was redefining a constant in the configuration, since
this value isn't used anywhere else there was no need to use a constant.
The conflicting ROOT contants was defined in `lib/logstash/patches/profile_require_calls.rb`
Fixes: #5163Fixes#5208
This commit introduce a mutex around the structured hash for the metric,
this hash is not updated frequently and its used mostly for the api to
be able to do search on the collected metric. Adding a mutex make sure
the changes are visible accross thread.
Fixes#5152Fixes#5178
When logstash reload a configuration the collector should remove all the
collected metrics from the store since it wont make any sense with a new
configuration. You should have the same behavior as when you restart
logstash.
Fixes#4801
Introduce the idea of a registry plugin placeholder where all necessary
interface to plugins is mantained, also simplified the internal registry
calls to be more generic.
Add a way to handle registrations for plugins explicitly
introduced the idea of self.plugin_type method to fetch plugin type from base clase, also removed the former plugins:mixin used to annotate defined plugins
make the config_name method also handle the registration to the plugin registry, that way old plugins get registration out of the box and we can simply incoming plugin registry without automatic loading
simplify the plugin registry by removing former need to load classes, now they all get registered automatically when using the config_name method
cleanup unnecessary former changes
updated typo in comments for the plugins registry and also removed internal attr_reader for the same class
renamed plugin annotate to declare_plugin to have a more meaningful name
change Registry::Plugin.gem_name -> cannonic_gem_name to reflect the idea of having probably also other non cannonic gem names
Fixes#4535