Commit graph

440 commits

Author SHA1 Message Date
Jordan Sissel
3d90908688 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
Andrew Cholakian
b28e56345a 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
fa3d991404 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:45:19 +00:00
Ry Biesemeyer
84dc5f6844
LSCL/LIR: enable plugins to have nested hash directives (#8751)
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.
2017-11-28 12:09:25 -08:00
Armin
f6d410c0a2 #8172 Move timestamp handling for metrics to java.lang.System.nano_time
Fixes #8180

Fixes #8731
2017-11-27 17:33:52 +00:00
Armin
d0dce28b21 #8728 Fix RubyTimestamp's '<=>' implementation to correctly compare to other types
Fixes #8730

Fixes #8733
2017-11-27 17:16:19 +00:00
Joao Duarte
7537412cda ensure logstash terminates on second sigint
As more java code is being used in logstash, it's likely that
java.lang.Threads which aren't set as daemon may be running when
`exit(1)` is called.

Because System.exit only raises a SystemExit exception, it's possible
that threads will continue to execute, and if they're not set as daemon
then the JVM won't terminate.

By calling `System.exit!` instead we ensure jruby calls the underlying
java.lang.System.exit and logstash terminates immediately.

Fixes #8729
2017-11-27 11:42:10 +00:00
Ry Biesemeyer
b1b7a79e76 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

Backports #8597

Fixes #8602
2017-11-08 01:02:34 +00:00
Guy Boertje
b23e525ae2 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:17:23 +01:00
Rob Bavey
546951fa88 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
Jake Landis
1b291247e5 PQ/DLQ Monitoring: Fix X-Pack and multi-pipeline monitoring
When X-Pack is installed an internal (hidden) pipeline named .monitoring-logstash is also running. This means that for X-Pack is there N +1 pipelines where N = user defined pipelines. The code currently only supports monitoring 1 pipeline, and it is possible that the internal pipeline gets picked up instead of the intended pipeline.

When multiple user pipelines are enabled (6.0+), the code still only supports monitoring 1 pipeline.

The change here is to ignore the system pipelines, and monitor as many user defined pipelines that may exist.

Fixes: #8382

Fixes #8472
2017-10-11 14:37:01 +00:00
Armin
550a6ea554 BUG: Fix filter_func logging for config.debug=true
Fixes #8456
2017-10-09 13:07:28 +00:00
Armin
840439722d PERFORMANCE: filter_func can optionally take an array of events to make batched filters much faster
Fixes #8428

Fixes #8444
2017-10-06 09:35:00 +00:00
Andrew Cholakian
0167dea0db Version bump to 6.0.0-rc2
This also updates the breaking changes for the ES output since this bump updates that as well.

Fixes #8417
2017-10-02 18:00:15 +00:00
Guy Boertje
63f8f86bde bump JrJackson/Jackson versions, source all version refs from versions.yml
final (I hope) fixes for consolidated versioning.

After testing with rake artifact:zip, need to try both files.
Add desc to rake test:install-* tasks, tired of
  not seeing them in rake -vT

changes requested via review

Fixes #8373

Fixes #8389
2017-09-26 17:48:35 +00:00
Armin
3fc1303ffa #8271 fix one excess '/' added to log config file uri on *nix in runner.rb
Fixes #8272
2017-09-15 13:15:51 +00:00
Rob Bavey
38bd1d4c1b 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
Colin Surprenant
4c413f0192 reword windows launch script
fixes

fix jvm.options parsing

windows compatible URI
2017-09-14 16:26:26 -04:00
Rob Bavey
19fcfe6e3b Removed unnecessary Password type check
Fixes #8226
2017-09-13 17:57:11 +00:00
Rob Bavey
1ceda5a27f 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
Andrew Cholakian
e70c813a71 Always log backtrace for converge / pipeline exceptions
Previously users had to enable --log.level=debug to see backtraces. These errors catch everything which can make debugging based on user reports difficult if not impossible.

Enabling --log.level=debug to solve these issues is not useful because users cannot enable it in production for rare errors.

Fixes #8156
2017-09-07 13:30:03 +00:00
Guy Boertje
dbf6a1d039 until dev_utils spec_helper is changed to new method name, alias it.
Fixes #8117
2017-09-01 05:54:17 +00:00
Guy Boertje
5c60888f66 Really fix verbose logging in tests
Fixes #8117
2017-09-01 05:54:17 +00:00
Colin Surprenant
c30c65c7c4 wait for pipeline thread to end before returning from the stop action 2017-08-31 20:32:43 -04:00
Colin Surprenant
1230168113 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:31:34 -04:00
Suyog Rao
925284fc9c [6.0] Bump version to RC1 (#8112) 2017-08-31 12:30:14 -07:00
Guy Boertje
2819f361b7 remove the unneeded require "logstash/util" call, has great expectations that cannot be met if required too early.
fixes #8096

Fixes #8097
2017-08-30 07:09:42 +00:00
Jake Landis
7f633af69f Metrics / Bug Fix: Protect against race condition in metrics reporting with multiple inputs.
Protect initialization of metrics obejcts with  mutex to prevent race condition. See https://github.com/elastic/logstash/issues/8011 for additional information.

Fixes #8011

Fixes #8027

Fixes #8047
2017-08-28 21:51:14 +00:00
Guy Boertje
da5e3c711c 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:52:04 -07:00
Rob Bavey
a00614a07e 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:20 +00:00
Suyog Rao
80c3dcad89 Remove metrics max bucket setting
PR #7451 introduced a way to set metrics max bucket settign in Kibana. This ain't good because
it can destabilize Kibana and ES as well

Fixes #8010
2017-08-16 23:17:53 +00:00
Colin Surprenant
8c44757679 bump to 6.0.0-beta2 2017-08-16 16:11:48 -04:00
Andrew Cholakian
35a4d202c1 Revert "create source_loader after logging setup"
This commit broke the plugin contract with plugins like xpack and caused many issues there. Reverted until it can be better handled.

This reverts commit 92cdbe2dbd.

Fixes #7995
2017-08-14 23:11:33 +00:00
Joao Duarte
bb392113cf create source_loader after logging setup
Fixes #7970
2017-08-11 13:18:33 +00:00
Aaron Mildenstein
0d23de64a2 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:52:12 -06:00
Suyog Rao
8ca403b862 Add log statement about modules that are run
Fixes #7963
2017-08-09 21:48:11 +00:00
Andrew Cholakian
e8a1164b2f Generate codec IDs randomly
Fixes #7930
2017-08-09 15:42:11 +00:00
Andrew Cholakian
2844a179cf Use LIR to generate vertex plugin IDs
In this patch we unify the IDs reported by LIR with those generated using config_ast.rb

This is a temporary fix until LIR execution is built. It relies on the fact that currently both LIR and config_ast.rb only operate on a single concatenated string of configurations. In the future LIR will compile different files separately, then merge their IRs. For now, however, this solution will hold.

This change also exposes the :id attribute of FilterDelegator to bring it to parity with OutputDelegator and InputDelegator which is required for testing purposes.

Fixes #7930
2017-08-09 15:42:11 +00:00
Joao Duarte
f17b2eb6c2 fix debug logging messages with thread values
Fixes #7954
2017-08-09 14:27:32 +00:00
Joao Duarte
a9218daa65 force exit on double SIGINT
Fixes #7918
2017-08-09 08:29:37 +00:00
Joao Duarte
97f5537828 prevent force shutdown to be blocked by with_pipelines
if force shutdown uses `with_pipelines` then it will never acquire the
`@pipelines_lock` from `shutdown_pipelines` until it terminates.

This PR makes force shutdown use `@pipelines` directly, fixing it.

Fixes #7918
2017-08-09 08:29:37 +00:00
Armin
a96adc1bce PERFORMANCE: Cache some metrics
Fixes #7919

Fixes #7946
2017-08-08 19:56:53 +00:00
Armin
a1457df649 PERFORMANCE: Don't use slow metric clocks where avoidable
Fixes #7919

Fixes #7946
2017-08-08 19:56:52 +00:00
Armin
d3083de43c PERFORMANCE: Cache some metrics
Fixes #7919

Fixes #7946
2017-08-08 19:56:52 +00:00
Armin
2ba8bfd55b Revert "PERFORMANCE: Generate more optimal filter_func"
This reverts commit 99a21bc5c1.

Fixes #7943
2017-08-08 19:17:09 +00:00
Armin
cf7a950028 PERFORMANCE: Generate more optimal filter_func
Fixes #7924
2017-08-08 15:43:30 +00:00
Jake Landis
d80da3e629 Revert "Performance: Use RubyArray.hash for metric's fast lookup key"
This reverts commit 9b4d7c51ae (master)

Fixes: #7925

Fixes #7927
2017-08-07 18:59:19 +00:00
Armin
ee7e6fb932 #7754 ensure we actually test periodic flushing in specs + make flush work without data input data
Fixes #7863
2017-08-04 16:31:11 +00:00
Rob Bavey
860fd2c5e6 Remove closed DeadLetterQueueWriters from 'Factory'
Fix bug where reloading a pipeline would close the DLQWriter, but
leave the closed version cached in the factory object, stopping
the reloaded pipeline from being able to write to the dead letter
queue.

Fixes #7840
2017-08-02 20:06:03 +00:00
Joao Duarte
cb2f01b4b6 fix a few issues with pipeline source loading
- allow empty config.string
- move all config autocompletion logic to the ConfigStringLoader
- gracefully handle absense of files in path.config
- ensure original_settings are restored in multi_local source after PipelineConfig creation

Fixes #7866
2017-08-02 12:33:57 +00:00