Commit graph

330 commits

Author SHA1 Message Date
Suyog Rao
17472eeac5 bump version to 5.4.3 (#7513) 2017-06-21 17:07:21 -07:00
Suyog Rao
76c4926f4d Add missing file 2017-06-14 17:26:42 -07:00
Armin Braun
5ed38319b6 #7449 fix missing require of environment_variables.rb in mixin.rb (#7454) 2017-06-14 17:24:09 -07:00
Armin
753c798ee2 #6696 validate evaluation result
Fixes #7411
2017-06-13 10:17:19 -07:00
Suyog Rao
a10326198f bump version to 5.4.2 (#7285) 2017-06-01 15:31:36 -07:00
Rob Bavey
3b4b9042ca 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
Suyog Rao
333dee60c6 bump to 5.4.1 (#7034) 2017-05-04 20:09:17 -07:00
TAC
f7c0839826 Fix missing log4j2.properties file on Windows
fix Issue #6352

On Windows, Logstash can't find log4j2.properties file with above message at startup.
```
Could not find log4j2 configuration at path /LS_HOME/config/log4j2.properties.
```

Fixes #6903
2017-05-03 19:30:42 +00:00
Colin Surprenant
f34cf4a1bc rephrase pipeline creation error message, fixes #6968 2017-04-26 10:16:00 -05:00
Pier-Hugues Pellerin
05d01cf20c Update the conditions to match the behavior of runner
Fixes #6943
2017-04-24 17:01:56 +00:00
Pier-Hugues Pellerin
8e099d49bd testing logic
Fixes #6943
2017-04-24 17:01:56 +00:00
Pier-Hugues Pellerin
111c95c254 Allow Finite pipeline to shutdown internal pipelines
With the creation of the x-pack we have added our first internal
pipeline, but if you were running the monitoring pipeline with a
finite pipeline (LIKE generator count => X) when the finite has
completed processing all the events logstash would refuse to stop.

This PR fixes the problem by adding a new pipeline settings called
system in the shutdown loop we will check if all the user defined
pipeline are completed if its the case we will shutdown any internal
pipeline and logtash will stop gracefully.

Fixes #6943
2017-04-24 17:01:56 +00:00
Joao Duarte
874a31e5ce add config_name to input plugin metrics
Fixes #6933
2017-04-20 08:22:50 +00:00
Pier-Hugues Pellerin
42166f3d52 Make the load_average linux more robust by allow to inject the content of the load_average file
Fixes: #6867

Fixes #6886
2017-04-19 19:45:29 +00:00
Pier-Hugues Pellerin
a159ac2db4 Replace the internal list of listeners with a set
Because we sync listeners with emitters when adding or creating hook
this could lead to duplicates of listeners, this PR fixes the problem by using a set
instead of a list. Making sure we can only have one instance of a specific
listener at any time.

Fixes #6916
2017-04-13 20:09:45 +00:00
Joao Duarte
cf0f2ebcda pass namespaced metric to output plugin instance 2017-04-10 17:36:40 +01:00
Pier-Hugues Pellerin
3986667f96 Missing require 'execution_context' in the backport
Missing require in 2dd135a162

Fixes #6897
2017-04-10 15:34:58 +00:00
Pier-Hugues Pellerin
2dd135a162
ExecutionContext for the plugins
This PR add the initial building block to pass some `ExecutionContext`
from the pipeline to the plugin, currently we only pass the `pipeline_id`.

We use the accessor `execution_context=` to set the context, in a future
refactor we will pass the object to the constructor.

Fixes #6890
2017-04-07 13:13:35 -04:00
Josh Soref
df57e410cc Spelling fixes (#6806)
Spelling fixes across the board.
2017-04-04 12:07:16 -07:00
Andrew Cholakian
80b8086ad8 Input#clone should also clone that input's codec
Some codecs are context-specific and not threadsafe. If, for instance,
you want to use `generator { threads => 3 }` you will run into buggy
behavior with the line and multiline codecs which are not threadsafe.

This patch is a quick workaround for this behavior. This does not fix
this issue for inputs that do their own multithreading. Those inputs
should handle codec cloning / lifecycle internally according to their
specific requirements.

Fixes #6865
2017-03-31 17:26:05 -04:00
DeDe Morton
347be1d381 Fix typo
Fixes #6845
2017-03-27 14:27:22 -04:00
Pier-Hugues Pellerin
cf57bcb99e Adding tests for the heap calculation, also changed the visibility
In retrospect, it just easier to expose the methods in the jvm spec
monitoring to be able to test them in isolation.

Fixes #6827
2017-03-26 20:43:13 -04:00
Pier-Hugues Pellerin
68151c894a Fix the heap collecting values
This PR fixes an issue where the max heap size was reported as the double of
the actual value because it was merging the values of the usage.max and
peak.max into a single value.

Fixes: #6608

Fixes #6827
2017-03-26 20:43:13 -04:00
Andrew Cholakian
a7bf577bfe Move input metrics to be nested under 'events' for consistency
Filters/outputs nest their 'out' metric under 'events'.
Inputs should not be different.

Fixes #6835
2017-03-23 19:32:58 -04:00
Pier-Hugues Pellerin
584a3860a0 Implements #has_metric?(*path)
Add a new method that uses the `fast_lookup` has to find if a specific
metric exist instead of relying on exceptions.

Usage:

```ruby
metric_store.has_metric?(:node, :sashimi, :pipelines, :pipeline01, :plugins, :"logstash-output-elasticsearch", :event_in) # true
metric_store.has_metric?(:node, :sashimi, :pipelines, :pipeline01, :plugins, :"logstash-output-elasticsearch", :do_not_exist) # false
```
Fixes: #6533

Fixes #6759
2017-03-14 20:32:01 -04:00
Pier-Hugues Pellerin
2fedad3c7d Record the events.in related statistic in the right place
This PR changes where the `events.in` are calculated, previously the
values were calculated in the `ReadClient` which was fine before the
addition of the PQ, but this make the stats not accurate when the PQ was
enabled and the producer are a lot faster than the consumer.

These commits change the collection of the metric inside an
instrumented `WriteClient` so both implementation of the client queues will use
the same code.

This also make possible to record `events.out` for every inputs and the
time waiting to push to the queue.

The API is now exposing theses values for each plugins, the events level
and and the pipeline.

Using a pipeline with a sleep filter and PQ we will see this kind of
response from the API.

```json
{
  "duration_in_millis": 438624,
  "in": 3011436,
  "filtered": 2189,
  "out": 2189,
  "queue_push_duration_in_millis": 49845
}
```

Fixes: #6512

Fixes #6532
2017-03-02 16:31:50 -05:00
Joao Duarte
d2d7a93b78 fix logic of logging configs
Fixes #6789
2017-03-02 15:01:09 -05:00
Tal Levy
1a02498e93 migrate core-queue-jruby into logstash-core (#6782)
Conflicts:
	logstash-core-queue-jruby/lib/logstash-core-queue-jruby/version.rb
	versions.yml
2017-03-02 10:13:31 -08:00
Tal Levy
7c75b59814 migrate logstash-core-event-java to logstash-core (#6760)
Conflicts:
	logstash-core-event-java/lib/logstash-core-event-java/version.rb
	versions.yml
2017-03-01 15:37:41 -08:00
Colin Surprenant
154ce65c3a add queue drain option support
wip queue drain option

metrics on empty batches

reenabled spec

cosmetic fixes

stats collection, mutex, specs, empty batch handling

start_metrics
2017-03-01 14:14:36 -05:00
Joao Duarte
c5b7cbeacc introduce locking in path.data
Fixes #6738
2017-02-24 05:27:10 -05:00
emile
de289435bb add deep environment variables replacement in configuration 2017-02-21 14:16:21 -08:00
Colin Surprenant
6838cdb588 use queue path in memory acked queue to namespace .lock file 2017-02-20 17:36:07 -05:00
Andrew Cholakian
9a130f2de1 Setting --path.data on CLI should also change path.queue
This change was harder than it first appeared! Due to the complicated
interactions between our Setting class and our monkey-patched Clamp
classes this required adding some new hooks into various places to
properly intercept the settings at the right point and set this
dynamically.

Crucially, this only changes path.queue when the user has *not*
overriden it explicitly in the settings.yml file.

Fixes #6378 and #6387

Fixes #6731
2017-02-17 16:43:07 -05:00
Suyog Rao
8515bbc8e7 Don't show config content when reload is not triggered
Fixes #6720
2017-02-16 16:43:57 -05:00
Pier-Hugues Pellerin
08827dc032 Collecting the ThreadCount and the PeakThreadCount should not trigger a threaddump
When we use the JRMonitor library to get information about the running
threads it will trigger a thread dump to get the stacktrace information this OK when
we do a direct call to the `hot_threads` API but in the context of the
periodic poller this would mean that the threads need to be stopped to
generate their current stacktrace.

Which could significantly slow down logstash. This PR use the **ThreadMXBean** but only use the `#getThreadCount` and the `#getPeakThreadCount`. Theses two calls won't generate a hreaddump and won't block the currents
threads.

**To test** add the following options to your `config/jvm.options` and let logstash run for a few minutes to trigger a few periodic poller iteration and stop logstash you will see the report.

```
-XX:+PrintSafepointStatistics
-XX:PrintSafepointStatisticsCount=1
```

Fixes: #6603

Fixes #6705
2017-02-14 13:13:59 -05:00
Colin Surprenant
f323e68ac7 cleanup partially initialized pipeline
DRY the plugin registration

typo

log exception message
2017-02-14 11:04:39 -05:00
Colin Surprenant
46e1068af6 support exclusive locking of PQ dir access
fix agent and pipeline and specs for queue exclusive access

added comments and swapped all sleep 0.01 to 0.1

revert explicit pipeline close in specs using sample helper

fix multiple pipelines specs

use BasePipeline for config validation which does not instantiate a new queue

review modifications

improve queue exception message
2017-02-10 17:38:03 -05:00
Suyog Rao
63d7520494 Better asciidoc formatting and text for ID option
Fixes #6679
2017-02-09 14:39:21 -05:00
Suyog Rao
cb9e8cf7c9 Revert to 5.4.0 version instead of 5.5.0 (#6672) 2017-02-08 20:33:32 -08:00
Suyog Rao
530c5fc43d Bump to v5.5 (#6670)
* Bump to v5.5
2017-02-08 19:38:07 -08:00
TAC
7abd136d00 Fix document format about plugin id
Fixes #6636
2017-02-08 14:39:19 -05:00
Jordan Sissel
2957c8f150 Do not show the configuration content anymore. Plugin validation errors and other config problems are more specifically logged before we get to this point, and showing the full config can too easily obscure a more actional 'you used an invalid setting' kind of error.
Fixes #6654
2017-02-07 19:27:10 -05:00
Joao Duarte
acdd400e97 add setting class that coerces value to array
Fixes #6630
2017-02-07 06:42:57 -05:00
Joao Duarte
ffa9c710a2 make SafeURI class clone deeper
Fixes #6645
2017-02-06 17:29:26 -05:00
Colin Surprenant
eba90f911d refactor agent pipeline reloading to avoid double live pipelines with same settings
extracted BasePipeline class to support complete config validation

minor review changes

added comment
2017-02-03 18:17:47 -05:00
Joao Duarte
4d28c401f0 fix shutdown watcher reports
since 5.x introduced log4j2 as the main logging mechanism, it's
necessary to be more explicit when logging complex objects.

In this case we tell the logger to use the .to_s version of the Snapshot
report generated by the Watcher.
The Snapshot#to_s calls .to_simple_hash.to_s

Fixes #6628
2017-02-02 10:28:48 -05:00
Joao Duarte
f5601ecbd7 propagate pipeline.id to api resources
this removes explicit references to the "main" pipeline,
using instead the value of the `pipeline.id` from LogStash::SETINGS

Fixes #6606
2017-01-30 12:46:20 -05:00
Joao Duarte
d6d0c672ae ensure pipeline.id is correctly propagated
Fixes #6530
2017-01-26 11:15:36 -05:00
Joao Duarte
b4c7c97452 include pipeline id in queue path
create queue sub directory based on pipeline id

Fixes #6540
2017-01-26 10:27:04 -05:00