Commit graph

1649 commits

Author SHA1 Message Date
Andrew Cholakian
373958f25c Bump concurrent gem dep to allow for more recent version
The old version (1.0.0) had a broken version of Concurrent::Timer that
did not work on all machines for reasons that are still unclear, but may
be related to the Java version

Fixes #7368
2017-06-07 19:56:54 +00:00
Guy Boertje
2793d780bd MODULES: Fixes for bad module specified and elasticsearch client logging silence (#7367)
* Fixes for bad module specified and elasticsearch client logging silence & iterate over the intersection of specified and available modules
2017-06-07 19:57:56 +01:00
Armin
554b4ad229 MINOR: Remove dead and duplicate code from Event and EventTest
Fixes #7360
2017-06-07 16:06:11 +00:00
Armin
5a693466e9 Performance: Use Jitted Lock call in wrapped_acked_queue
Fixes #7300
2017-06-07 02:53:59 +00:00
Armin
b5c24ae438 Performance: Use Jitted Lock call
Fixes #7300
2017-06-07 02:53:59 +00:00
Armin
842658f3a6 lock more efficiently
Fixes #7300
2017-06-07 02:53:59 +00:00
Suyog Rao
dcd79d2f57 bump master version to 6.0.0-alpha3 (#7343)
* bump master version to 6.0.0-alpha3
2017-06-06 11:51:02 -07:00
Guy Boertje
06c97acea7 use common 2017-06-06 17:38:16 +01:00
Guy Boertje
96df9a7e71 extract common for cherrypick 2017-06-06 17:38:06 +01:00
Pier-Hugues Pellerin
8120475844 Add missing dependency on manticore (#7319)
With the merge of https://github.com/elastic/logstash/pull/7284, Logstash
now depends on elasticsearch client to setup modules.

To be usable under jruby we also need to depends on manticore, this
problem is only show when try to use the logstash-core gem directly and
not in the Logstash project since it bundle the elasticsearch output
with the manticore dependency.
2017-06-05 16:06:48 -07:00
Aaron Mildenstein
55093594de CEF changes (#7320) 2017-06-05 14:56:10 -07:00
Aaron Mildenstein
f443dae5fe Merge feature/modules into master (#7284)
* My changes (#7218)

* First upstream PR commit (#7172)

No tests yet.  Just for code review for now

* move all inner classes to their own folder + client and importer

* Fixes and tests (#7228)

Add tests for the `LogStash::Modules:CLIParser` class in `cli_parser.rb`
Fix a typo in `cli_parser.rb` (`uparsed` vs `unparsed`)
Fix a bad variable name found by testing in `cli_parser.rb` and update the error message accordingly in `en.yml`

* Remove fb_modules (#7280)

* fixes to import index-pattern & var updates & savedsearch capability (#7283)

* fixes to import index-pattern & var updates & savedsearch capability

fixes to import index-pattern & var updates

add savedsearch capability

* minimise merge conflicts with PR End-to-End test with filebeat apache2

* End-to-End test with filebeat apache2 (#7279)

This is a first run, but data flows from filebeat through Elasticsearch.

Template uploads from `$LS_HOME/modules/MODULENAME/configuration/elasticsearch/MODULENAME.json`

Specifying `--modules filebeat` from the command-line, with `-M "filebeat.var.elasticsearch.output.host=localhost:9200"`

Some of the saved searches don't get uploaded. @guyboertje is on this already.

The logstash configuration needs tweaking to allow receiving both access logs _and_ error logs.  The dashboards and visualizations all seem to expect the presence of both.

Set default to `localhost` in `elasticsearch_client.rb`

Changed command-line variable parsing to allow for a variable with only `modulename.key.subkey=value`, and updated the error message accordingly.

First draft of the filebeat module, as extracted from filebeat 5.4.0

* Add documentation for Modules

This is specific to the Master branch.  Multiple modules will not be supported in 5.5.

* Add READMEs and prune post-code comments

* Add comment regarding the variable name `modul`

Also, fix the default username for the Elasticsearch output in Logstash.  The default x-pack credentials are `elastic:changeme` rather than `elasticsearch:changeme`

* add cef module files (#7292)

* fixes from reviews of PR #7284
2017-06-05 18:49:35 +01:00
Armin
c945a043f6 MINOR: Clean upgrade to Gradle 3.5
Fixes #7305
2017-06-05 06:50:25 +00:00
Armin
1ba335e329 MINOR: Cleanup imports on compiler.rb and pipeline.rb
Fixes #7297
2017-06-03 07:08:04 +00:00
Armin
e80bfe45e7 MINOR: Dry up gradle settings
Fixes #7298
2017-06-03 07:07:28 +00:00
Armin
5bb7e2b436 MINOR: Cleanup for org.logstash.FieldReference
Fixes #7259
2017-06-03 03:20:24 +00:00
Armin
01b812b5cf MINOR: Fix missing static identifiers and save some memory
Fixes #7261
2017-06-02 22:07:53 +00:00
Armin
a3a077c348 #7184 avoid broken format being used in test
Fixes #7262
2017-06-02 21:43:59 +00:00
Andrew Cholakian
280722ea70 Make SafeURI 9k compatible by using java.net.URI internally
Ruby 2.0's stdlib no longer allows relative IPv6 URLs like: //[::1]
This is a key feature of the Elasticsearch output. See more in
https://github.com/logstash-plugins/logstash-output-elasticsearch/issues/604

The only way to fix this is to use a better URI class which means
introducing a slight incompatibility here. I don't believe that anyone
is using the URI class other than the ES output, and I don't that there
is anyone using any portions of the API here that are no longer
compatible.

Normally we would only make such a change in a major version, but our
hands are tied here. If we are to go with JRuby 9k, which is critical
for support we must use a different, better, library.

java.net.URI is stable and works well, so its probably superior in the
long run anyway.

Fixes #7236
2017-06-02 20:52:27 +00:00
Armin
39a0df1723 MINOR: Removed redundant contant
Fixes #7289
2017-06-02 09:41:57 +00:00
Tal Levy
db9ab809a7 update RecordIOWriter javadoc to further describe file-structure 2017-05-31 11:05:13 -07:00
Suyog Rao
e01d247d5e revert to alpha2 until we release 2017-05-31 08:41:12 -07:00
Suyog Rao
23604c13c1 bump version to 6.0.0-beta1 (#7278) 2017-05-31 08:39:13 -07:00
Rob Bavey
58c0a39ff9 Refactor ByteBufferPageIO._persistedByteCount() #6594
Remove static method in ByteBufferPageIO, replacing with static test helper method to move
the required functionality to a single place.

Cleans up HeadPageTest, using try... with resources in place of explicit, and
potentially missed, close() calls.

Adds elastic/securemock mocking framework dependency

Resolves #6594

Fixes #7268
2017-05-31 13:45:20 +00:00
Armin
f14d550c6a MINOR: Remove dead methods
Fixes #7266
2017-05-30 20:29:17 +00:00
Armin
311056757c MINOR: Remove duplicate TimeStamp serializer class
Fixes #7265
2017-05-30 13:07:47 +00:00
Armin
58a3f887c5 Added test for list append
Fixes #7247
2017-05-30 13:06:04 +00:00
Armin
d929a4daf6 MINOR: Optimized map merge in org.logstash.Util#mapMerge
Fixes #7247
2017-05-30 13:06:04 +00:00
Armin
b65f737bfd MINOR: Remove duplicate hash keys
Fixes #7263
2017-05-30 09:33:53 +00:00
Joao Duarte
bed8b8a084 support multiple pipelines in one logstash instance
* add multi_local source for multi pipelines
* introduce pipelines.yml
* introduce PipelineSettings class
* support reloading of pipeline parameters
* fix pipeline api call for _node/pipelines
* inform user pipelines.yml is ignored if -e or -f is enabled
2017-05-30 09:47:53 +01:00
Armin
b1d8a4b2e3 #7256 close channel underlying the queue's filelock
Fixes #7257
2017-05-30 05:50:18 +00:00
Armin
fe58408a2e MINOR: Remove unused imports
Fixes #7260
2017-05-30 05:39:35 +00:00
Armin
37cb063a8f MINOR: Remove unused function from Page
Fixes #7258
2017-05-30 05:38:33 +00:00
Armin
db276702b3 remove question only todo
Fixes #7248
2017-05-29 20:20:19 +00:00
Armin
c95e643209 #7239 fix timeunit on cpu time metric
Fixes #7240
2017-05-27 20:00:13 +00:00
Andrew Cholakian
9ce6963094 Further improve pipeline thread safety
Fixes #7230

Further improves on the threadsafety improvements in #7206

This commit fixes various tests to access the Agent#pipelines property
in a fully threadsafe way.

Fixes #7233
2017-05-26 16:33:48 +00:00
Armin
c80eabbc9d #7111 cleaned up one case of redundant CRC32 digest and byte[] creation. Adjusted benchmark checkpoint interval to default value to be able to judge performance impact of the move.
Fixes #7166
2017-05-26 04:47:19 +00:00
Andrew Cholakian
b103e3fc97 Make access of Agent#pipelines threadsafe
Universal plugins may access the #pipelines property of the agent.
This PR makes accessing it in a threadsafe way possible with a
`with_pipelines` helper function in Agent.

This uses a reentrant lock since its anticipated that users may want to
nest calls here. A ruby Mutex is not reentrant, so that won't work.

Fixes #7206
2017-05-25 13:52:02 +00:00
Pier-Hugues Pellerin
8e43ecaf46 Removed a flaky test in agent_spec in favor a refactored one in converge_spec
We remove a flaky test "LogStash::Agent#execute when auto_reload is true if state is clean should periodically reload_state"
in favor of the refactored test in `converge_spec`, since it doesn't use
rspec mock but instead use a threadsafe spies to make sure we do
multiple call on the source loader.

Fixes: #7196

Fixes #7200
2017-05-24 23:50:59 +00:00
Wainer dos Santos Moschetta
4163af5bea Add test case for FileLockFactory
This change introduce a test for cross-process/jvm file locking
using the FileLockFactory class. It uses a client program that
will lock a file aftwards the test case proceed.

Fixes #6610

Fixes #7117
2017-05-24 02:20:36 +00:00
Rob Bavey
a170e73571 Fix Javadoc warning
Adds an @return value to fix the JavaDoc error

Fixes #7176
2017-05-22 23:57:20 +00:00
Rob Bavey
7537b62c8d Fix NoMethodError when Stack Trace is empty
Adds :traces to hash even if traces are empty.

Fixes #7174

Fixes #7175
2017-05-22 13:02:17 +00:00
Rob Bavey
3e13b33e44 Move code from JRmonitor into logstash-core #6337
Java code is mostly the same as that from the JRMonitor gem with some general tidying and DRYing up
Report classes are now straight Java
Added junit tests for the Java monitor classes
Ruby code basically stays the same, other than calling out to pure Java report classes

Fixes #7167
2017-05-19 21:09:52 +00:00
Suyog Rao
cfecf81091 Only glob *.conf by default in conf.d folder (#7130)
* Only glob *.conf by default in conf.d folder

Fixes #6979, Fixes #1831
2017-05-19 11:26:10 -07:00
Armin
e8b4548ef5 MINOR: Remove dead code from org.logstash.ackedqueue.io.AbstractByteBufferPageIO
Fixes #7169
2017-05-19 18:02:46 +00:00
Armin
71dc852b9d MINOR: Prevent leaking threads from QueueTest
Fixes #7163
2017-05-19 10:33:16 +00:00
Armin
9fe4e9b3b7 MINOR: Clean up redundant matchers in QueueTest
Fixes #7161
2017-05-19 08:54:42 +00:00
Armin
b7f4fd7ebf Cleanup Queue not being safely closed in QueueTest
Fixes #7063
2017-05-19 05:04:37 +00:00
Armin
64397c66e3 Fix FD leak in FileCheckpointIO, closes #7150
Fixes #7151
2017-05-18 18:35:44 +00:00
Pier-Hugues Pellerin
b00b7f9656 Prevent variable leak between test
When running this test with a newer version of rspec we got the warning
that some values where leaking between example:

```
 1) LogStash::ShutdownWatcher when pipeline is not stalled .unsafe_shutdown = false shouldn't force the shutdown
     Failure/Error: m.call(*args)
       The use of doubles or partial doubles from rspec-mocks outside of the per-test lifecycle is not supported.
     # ./logstash-core/lib/logstash/shutdown_watcher.rb:67:in `pipeline_report_snapshot'
     # ./logstash-core/spec/logstash/shutdown_watcher_spec.rb:22:in `block in /Users/ph/es/second/logstash/logstash-core/spec/logstash/shutdown_watcher_spec.rb'
     # ./logstash-core/lib/logstash/shutdown_watcher.rb:44:in `block in start'
     # ./vendor/bundle/jruby/2.3.0/gems/stud-0.0.22/lib/stud/interval.rb:20:in `interval'
     # ./logstash-core/lib/logstash/shutdown_watcher.rb:42:in `start'
     # ./logstash-core/spec/logstash/shutdown_watcher_spec.rb:93:in `block in (root)'
```

We have added a few helpers method in the class that allowed us to
simplify the expectation and removed any usage of `Thread#kill`

Fixes #7152
2017-05-18 17:07:23 +00:00