Commit graph

1649 commits

Author SHA1 Message Date
Tal Levy
f78da5ffe0 check versions.yml for correct project version (#5882)
- and fix a test
2016-10-07 12:00:25 -07:00
Joao Duarte
ce0c5e2bf2 skip sighup handling on windows
Fixes #6005
2016-10-07 10:39:28 -04:00
Suyog Rao
6f9ce48adb Fix issue with long message
Fixes #5999
2016-10-06 12:26:23 -04:00
Suyog Rao
7da292a3b0 Make sure we log stuff using logger
Partially addresses #5975

Fixes #5999
2016-10-06 12:26:23 -04:00
Suyog Rao
b8cba25082 Pin terms-ansicolor the right way
Fixes #5992
2016-10-03 17:56:18 -04:00
Andrew Cholakian
b119e113c1 Pin term-ansicolor to version that doesn't require ruby >= 2.0
Fixes #5980
2016-09-30 05:33:06 -04:00
Pier-Hugues Pellerin
cfd39c377e Correctly calculate the time spend in the filter + output block
This PR fix an issue where the time was calculated but no work was done
on the event. This code make sure we have at least one event to start
recording the time spend.

This was causing the `events/duratin_in_millis` to not be in sync with
the time spend on the filtera, since `take_batch` was called in a tight
loop and could return an empty array this made the duration was way off.

Fixes: #5952

Fixes #5953
2016-09-20 20:08:42 -04:00
Radu Gheorghe
2c57f92fd3 Fix typo in bind error
`--http-port` should be `--http.port`

Fixes #5940
2016-09-18 13:56:46 -04:00
Pier-Hugues Pellerin
f0ae34e25a Fix a concurrency issue with the Webserver when overrideing Puma STDERR and STDOUT.
This PR changes how we modify the STDOUT/STDERR in puma, instande of
using `const_set`, we override the constants using a module.
This operation should be thread safe and will make sure the STDERR are
correctly visible.

After when we receive the logger we can swap the null logger with the
real thing in a thread safe way.

Fixes: #5912

Fixes #5918
2016-09-16 10:55:53 -04:00
Pere Urbon-Bayes
0daeec7e04 fix logstash-core show version method to use proper logger info checks
Fixes #5927
2016-09-15 13:04:36 -04:00
Joao Duarte
c1e3fcc1bf when a reload fails there should be at least one failure count
Fixes #5923
2016-09-15 12:56:15 -04:00
Tal Levy
b072d93c85 fix tests and bring back configure logging in runner
Fixes #5901
2016-09-13 17:08:35 -04:00
Tal Levy
63233b1cf1 respect log.format and path.logs from cli
also change how `log.level` is configured at startup time to be set
as a property directly in the log4j2.properties file

Fixes #5900
2016-09-13 16:45:30 -04:00
Tal Levy
2cf53cedf5 Set default log.level to INFO
sets default to INFO and updates some verbose logging to
more appropriate, less verbose log levels where it makes sense.

Closes #5735.
Closes #5893.

Fixes #5898
2016-09-13 16:43:20 -04:00
Pier-Hugues Pellerin
70646ad5b0 Return 404 on non existant resources
This PR introduce a changes to make sure the API endpoint correctly
return 404 in every case. To make it work it uses an exception that get
pickup up in the base class by the `error` handler.

Using the exception template allow the code to be dry and make sure all
other errors can be returned with the same format.

Example or a 404.
```json
{
"error": { "message": "Not Found"},
"path": "/this-should-not-exist"
"status": 404
}
```

The code will also set the content-type and the right error code in the
header.

Fixes: #5874, #5622

Fixes #5897
2016-09-13 14:15:16 -04:00
Tal Levy
79e7daf746 add logging api endpoint
PUT /_nodes/logging -- sets log levels
GET /_nodes/logging -- retrieves log levels of existing loggers

Fixes #5871
2016-09-13 03:46:28 -04:00
Tal Levy
61ebeb0b4b update path.log to path.logs directory, and respect it in log4j2
Fixes #5876
2016-09-08 18:06:30 -04:00
Suyog Rao
65a8676a86 Bump master to 6.0.0-alpha1 (#5880)
* Bump master to 6.0.0-alpha1
2016-09-08 08:33:27 -07:00
Pier-Hugues Pellerin
09a4d35687 Silence PUMA errors when an exception occur in logstash core
When Logstash encounter an exception Puma was getting really noisy about
the file descriptor it used. Its because Puma has an infinite loop into
his reactor and when logstash is dying from the exception the FD get
removed under the puma threads.

Puma is using the constants `STDERR` and `STDOUT` to give information
about the errors, there is no easy way to provide Puma with a custom IO.
This PR hacks the Puma name to redefine both constants and send the
information to the logger using the `debug` level.

Also when we start the server we can pass a custom Puma::Events instance
to record some of the errors happening in the internal threads, this PR
also make sure we send all theses message to the configured logger.

Fixes: #5822

Fixes #5869
2016-09-08 09:39:45 -04:00
Joao Duarte
00917ec758 minor improvements in agent specs regarding pipeline metrics
Fixes #5848
2016-09-06 09:18:37 -04:00
Joao Duarte
27dd7147dc tests for pipeline reload metrics
Fixes #5848
2016-09-06 09:18:37 -04:00
Joao Duarte
f3e092df67 add metrics regarding pipeline reloading
Fixes #5848
2016-09-06 09:18:37 -04:00
Joao Duarte
9fd35ad4bb partially reset counters during pipeline reload
Fixes #5819
2016-08-29 12:37:58 -04:00
Tal Levy
bc080ca7b5 fix. add vendor files to logstash-core gem
Fixes #5838
2016-08-26 15:01:03 -04:00
Tal Levy
1b2f7a7668 Migrate Logstash to Log4j2 Logging (#5651)
Migrate to use Log4j2 for Logstash logging
2016-08-25 10:30:22 -07:00
Andrew Cholakian
6de1c83c4a Use the id, not plugin_args as plugin info in pipeline reporter for outputs.
The plugin args are not really necessary for reporting. Now that we have unique IDs
that's a better way to figure which output is which without potentially sharing
sensitive data.

This fixes hanging tests in the previous commit

Fixes #5827
2016-08-25 09:37:18 -04:00
Andrew Cholakian
3696bcad4a Improve OutputDelegator public API
This minimizes the OutputDelegator public API

Fixes https://github.com/elastic/logstash/issues/5813

Fixes #5827
2016-08-25 09:37:18 -04:00
Andrew Cholakian
cf3557a851 Add workers not supported error message for legacy plugins.
Fixes https://github.com/elastic/logstash/issues/5823

Fixes #5826
2016-08-24 15:51:13 -04:00
Andrew Cholakian
5be74fca22 Properly set Output Metrics in Output Delegator Strategy.
Fixes https://github.com/elastic/logstash/issues/5810

Fixes #5825
2016-08-24 15:39:19 -04:00
Colin Surprenant
31392e7fb0 base SignalEvent class and cleanup LogStash namespace 2016-08-23 17:12:19 -04:00
Pier-Hugues Pellerin
3f4190e7f4 Make sure the name of the plugin is saved in the metric store
Fixes: #5799

Fixes #5800
2016-08-23 11:55:29 -04:00
Joao Duarte
1f5ae55bef add missing locale flag messages
Fixes #5785
2016-08-23 10:01:48 -04:00
Joao Duarte
8cd64ee07e allow deprecated quiet/debug/verbose flags to be set
Fixes #5785
2016-08-23 10:01:48 -04:00
Andrew Cholakian
33c0a8e89d Add new Codec#encode_sync, Codec#multi_encode and Output#multi_receive_encoded methods.
These methods allow outputs to receive their events pre-encoded for them
by the pipeline. This is mostly useful in the context of `#shared` outputs, for whom
encoding a discrete batch in a threadsafe way is not necessarily straightforward.

It would be advised for codecs to prefer `#multi_encode` as the main way of operating
as the standard `#encode` method is not threadsafe.

Fixes #5770
2016-08-22 14:08:04 -04:00
Pier-Hugues Pellerin
5d4a3aeeb6 Add GC stats to the api
This PR introduce GC stats in the form of `collection_time` and `collection_count`, it takes the configured gc and categorize them
into old and young.

Example output:

```
gc: {
  collectors: {
    young: {
      collection_time_in_millis: 22101,
      collection_count: 5452
    },
    old: {
      collection_time_in_millis: 57,
      collection_count: 1
    }
  }
}
```

Fixes: #5730

Fixes #5788
2016-08-22 13:17:25 -04:00
Pier-Hugues Pellerin
cf3a424609 Clear the inflight clock hashmap after stopping a clock
Fixes #5792
2016-08-22 13:16:39 -04:00
Pier-Hugues Pellerin
ab9f3b79be Expose duration of the Filter+Output part of the pipeline
This PR will expose the time spend of a batch in the filter + output

Ouput:
http://localhost:9600/_node/stats/pipeline
```
events: {
	duration_in_millis: 18364,
	in: 309325,
	filtered: 309325,
	out: 309325
},

	```

	Fixes: #5731

Fixes #5792
2016-08-22 13:16:38 -04:00
Andrew Cholakian
f57b5f0cb1 Cleanup OutputDelegatorStrategy refactor
This fixes two issues:

1. This fully removes the xopts parameter which for Shared and Single concurrency would prevent outputs from receiving their parameters
2. This cleans up the injection of the OutputDelegatorStrategyRegistry.

This also bumps the plugin api version to 2.1.12

Fixes #5794
2016-08-22 12:54:57 -04:00
Pier-Hugues Pellerin
aaa3352d0f Adding the values for the automatic reloading to the API
```
config_reload_automatic: true,
config_reload_interval: 3
```

Fixes: #5681

Fixes #5780
2016-08-22 12:03:27 -04:00
Pier-Hugues Pellerin
1327fab555 Remove mem block from /node
Fixes #5789
2016-08-22 11:55:08 -04:00
Joao Duarte
60cf97c8c2 don't warn of wrong path.settings with --help
Fixes #5786
2016-08-22 10:56:24 -04:00
Joao Duarte
c9eff28fb2 minor english improvement
Fixes #5786
2016-08-22 10:56:24 -04:00
Joao Duarte
bb46aa6188 tolerate bad path.settings when --help is present
Fixes #5786
2016-08-22 10:56:23 -04:00
Pier-Hugues Pellerin
672b369c41 --http.port Now accept a port range
This PR does a few modifications for our webserver:
 - Add a PortRange setting type.
 - allow the --http.port option to accept a port range or a single port, when a range is provided Logstash will incrementally try this list to find a free port for the webserver.
 - Logstash will report in the log which port it is using. (INFO LEVEL)
 - It refactors a few methods of the webserver.
 - It adds test for the binding of the ports.

Notes:

Port range can be defined in the logstash.yml or pass via the command line like this.

 `bin/logstash -e 'input { generator {}} output { null {}}' --log.level verbose --http.port 2000-2005`

Fixes #5774
2016-08-19 08:04:00 -04:00
Andrew Cholakian
f68b2c0841 Cleans up output delegators and simplifies a few other aspects of plugins
The new way Output Delegators work is that events flow from:
OutputDelegator -> OutputDelegatorStrategy -> Output

The output delegator handles all the common denominator tasks (like metrics) and
a few other things. The OutputDelegatorStrategy handles concurrency and Output instantiation.
This is a significant improvement and simplification over the past where we used mixins and dynamic method
redifinition.

This removes the concept of plugin 'unique_names' and replaces it with the 'id'.
Also consistently autogenerates plugin IDs based on a given config file using SHA1 hashing.

Fixes #5752
2016-08-18 16:50:41 -04:00
Joao Duarte
f00fadd6fc add more numeric setting classes and control cli numeric coersion
Fixes #5773
2016-08-18 09:20:26 -04:00
Pier-Hugues Pellerin
6d0af1b9b1 make the human? method part of the base api class
Fixes #5766
2016-08-18 09:16:59 -04:00
Pier-Hugues Pellerin
f2d0dced6f make the thread count more reliable
Fixes #5766
2016-08-18 09:16:59 -04:00
Pier-Hugues Pellerin
db5edacf9a adding test for the human hot_threads call
Fixes #5766
2016-08-18 09:16:59 -04:00
Pier-Hugues Pellerin
6c88649afe Small improvements for the hot_threads api
- Fix the typo in the human format
- Make sure we use the I18n string for the output

Fixes #5766
2016-08-18 09:16:59 -04:00