Commit graph

328 commits

Author SHA1 Message Date
Suyog Rao
8f39da19b8 Bump to 5.1.3 (#6666)
* bump to 5.1.3
2017-02-08 21:05:38 -08:00
Joao Duarte
fe885a4a11 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
Mykola Shestopal
65bb4c70c8 Fixed calculation of took_in_millis for #6476
Fixes #6481
2017-01-04 11:43:56 -05:00
Colin Surprenant
46a82fb2c9 avoid resetting inexisting tags field back to empty array plus specs
Fixes #6477
2017-01-03 22:31:55 -05:00
Pier-Hugues Pellerin
bc01bd1fb0 bump version to 5.1.2
Fixes #6381
2016-12-08 15:24:20 -05:00
Pier-Hugues Pellerin
12658724b5 Impose strict version to logstash-core-event-java and logstash-core-queue-jruby
Fixes #6381
2016-12-08 15:24:19 -05:00
Pier-Hugues Pellerin
d9f9522fdd Only include logstash-core.jar in the published gem
Fixes #6377
2016-12-08 15:00:55 -05:00
Pier-Hugues Pellerin
7e6ba7682e Do not include Utils, this could cause some bad references on the LogStash::Environment in the context of stand alone gems
Fixes #6377
2016-12-08 15:00:55 -05:00
Pier-Hugues Pellerin
643568038f Change the assertions in the config reloading spec
The assertions was using dummy outputs and kept received events into an
array in memory, but the test actually only needed to match the number
of events it received, this PR add a DroppingDummyOutput that wont
retain the events in memory.

The previous implementation was causing a OOM issue when running the
test on a very fast machine.

Fixes: #6335

Fixes #6346
2016-12-02 13:24:08 -05:00
Suyog Rao
86ef0d9190 Bump version to 5.1.1 (#6334) 2016-11-30 15:48:59 -08:00
Guy Boertje
ee40051271 Allow for exception instances to get serialized in JSON logging 2016-11-30 15:45:19 -08:00
Joao Duarte
7b07a397e2 minor style change in getQueueMaxBytes implementation
Fixes #6297
2016-11-29 05:10:44 -05:00
Joao Duarte
a4140dab6b make some Queue tests less aggressive on Thread.sleep usage
Fixes #6297
2016-11-29 05:10:44 -05:00
Joao Duarte
fe4118288e rename queueMaxSizeInBytes to queueMaxBytes and currentSize to currentByteSize
Fixes #6297
2016-11-29 05:10:44 -05:00
Joao Duarte
f0905e6e5d add ruby wiring to the queue.max_size setting
Fixes #6297
2016-11-29 05:10:43 -05:00
Joao Duarte
e78e79f6cb fix broken resumeWriteOnNoLongerFullQueueTest
Fixes #6297
2016-11-29 05:10:43 -05:00
Joao Duarte
245e206e83 remove per write track of queue size
Fixes #6297
2016-11-29 05:10:43 -05:00
Joao Duarte
9a467776a8 ensure maxQueueSizeInBytes and maxSizeInBytes is a long
Fixes #6297
2016-11-29 05:10:43 -05:00
Joao Duarte
882acda239 add failing test for recovery from a full queue
Fixes #6297
2016-11-29 05:10:43 -05:00
Joao Duarte
697f6c1edf queue test cleanup
Fixes #6297
2016-11-29 05:10:43 -05:00
Joao Duarte
2f6a472f52 first step in having maxQueueSizeInBytes
Fixes #6297
2016-11-29 05:10:43 -05:00
Colin Surprenant
38fc84b367 add support for queue.checkpoint.{acks|writes} settings
add queue.max_acked_checkpoint and queue.checkpoint_rate settings

now using checkpoint.max_acks, checkpoint.max_writes and checkpoint.max_interval

rename options

wip rework checkpointing

refactored full acked pages handling on acking and recovery

correclty close queue

proper queue open/recovery

checkpoint dump utility

checkpoint on writes

removed debug code and added missing newline

added better comment on contiguous checkpoints

fix spec for new pipeline setting
2016-11-22 15:55:32 -05:00
Andrew Cholakian
f66145a596 Fix filter 'id' naming to be consistent with inputs / outputs
The filters were the only category prefixing IDs with their plugin names

Fixes #6259
2016-11-22 14:42:44 -05:00
Pier-Hugues Pellerin
00e225a849 Feature: A way to install/remove a plugin pack
A pack in this context is a *bundle* of plugins that can be distributed outside of rubygems; it is similar to what ES and kibana are doing, and
the user interface is modeled after them. See https://www.elastic.co/downloads/x-pack

**Do not mix it with the `bin/logstash-plugin pack/unpack` command.**

- it contains one or more plugins that need to be installed
- it is self-contains with the gems and the needed jars
- it is distributed as a zip file
- the file structure needs to follow some rules.

- As a reserved name name on elastic.co download http server
    - `bin/plugin install logstash-mypack` will check on the download server if a pack for the current specific logstash version exist and it will be downloaded, if it doesn't exist we fallback on rubygems.
    - The file on the server will follow this convention `logstash-mypack-{LOGSTASH_VERSION}.zip`

- As a fully qualified url
    - `bin/plugin install http://test.abc/logstash-mypack.zip`, if it exists it will be downloaded and installed if it does not we raise an error.

- As a local file
    - `bin/plugin install file:///tmp/logstash-mypack.zip`, if it exists it will be installed

Fixes #6168
2016-11-17 14:00:02 -05:00
Pier-Hugues Pellerin
36a6e444d7 Theses core input are not currently used inside logstash so it make sense to remove them
Fixes #6268
2016-11-17 11:54:34 -05:00
Tal Levy
329b6a4ff1 add logstash-core resources to classpath during development
Fixes #6235.

Fixes #6237
2016-11-16 08:50:47 -05:00
Pier-Hugues Pellerin
e32c8efdce move the loadAverage class into his own file and do the same for the specs
Fixes #6240
2016-11-14 08:59:39 -05:00
Pier-Hugues Pellerin
9c9b4a42bb Monitor the load average of the machine and display it in the api
This PR add new information in the /_node/stats api and will return the
load average of the machine in the following formats depending of the
platforms that logstash is running on:

**Linux**
```json
{
    "cpu" : {
      "percent" : 26,
      "load_average" : {
        "1m" : 2.826171875,
        "5m": 1.8261718,
        "15m": 1.56566
      }
    }
}
```

**MacOS and other platform that the OperatingMXBean understand**
```json
{
    "cpu" : {
      "percent" : 26,
      "load_average" : {
        "1m" : 2.826171875,
      }
    }
}
```

Load average is not available on Windows

Fixes: #6214

Fixes #6240
2016-11-14 08:59:39 -05:00
Suyog Rao
5b21ca10ff shutdown after spec
Fixes #6236
2016-11-11 11:52:19 -05:00
Suyog Rao
26bf1e4f21 Add JVM uptime stats
Fixes #6236
2016-11-11 11:52:19 -05:00
Suyog Rao
6f77dc4047 Add uptime millis stats
Fixes #6236
2016-11-11 11:52:19 -05:00
Pier-Hugues Pellerin
21c435a5b3 bad merge
Fixes #6109
2016-11-11 09:43:44 -05:00
Pier-Hugues Pellerin
84a747cdfe Add a transient_settings concept to the settings handling
When we load a yml file in logstash if a key isn't not found in the
settings, we move that key and the corresponding value to a
`transient_settings` hash. This give the time to the plugin to register
new settings. When we call #validate_all we merge the
`transient_settings` hash and do the validation, if a key is not found
at that stage an excepton will be throw.

Fixes #6109
2016-11-11 09:43:44 -05:00
Pier-Hugues Pellerin
f86f1377cc Chagne PluginRegistry -> PLUGIN_REGISTRY
Fixes #6109
2016-11-11 09:43:44 -05:00
Pier-Hugues Pellerin
e85f31962e fixes from reviews from @joao
Fixes #6109
2016-11-11 09:43:44 -05:00
Pier-Hugues Pellerin
b1c62da570 rescope the mock classes
Fixes #6109
2016-11-11 09:43:44 -05:00
Pier-Hugues Pellerin
9ee34a3c6f adjust the specs
Fixes #6109
2016-11-11 09:43:44 -05:00
Pier-Hugues Pellerin
202221edc1 fixing the tests
Fixes #6109
2016-11-11 09:43:44 -05:00
Pier-Hugues Pellerin
ab89a90a4c This PR changes two things:
- Allow plugins author to decide how their plugins are structured
- Allow a new kind of plugin that allow plugins author to add hooks into logstash core.

Fixes #6109
2016-11-11 09:43:44 -05:00
Joao Duarte
4e75d4dc60 mark reload as failure if pipeline.run aborts
currently a reload is only marked as a failured if it fails the classic
config test check, where we check for parameter names, existing plugins, etc.

This change waits for the pipeline to transition to running before
marking the reload as success, otherwise it is a failure.

fixes #6195

Fixes #6196
2016-11-10 05:27:01 -05:00
Pier-Hugues Pellerin
3b3704430f Enable back the WritableDirectory spec
A few days ago I've created this PR[1] to to enable the writable directory
spec to pass on macos X. When the PQ got merged in the master branch the
test was disabled again[2].

[1] https://github.com/elastic/logstash/pull/6110
[2] 761f9f1bc9

Fixes #6218
2016-11-09 09:00:07 -05:00
Andrew Cholakian
efefe7f32a Add Persistent UUID for Agent
This adds two new fields 'id', and 'name' to the base metadata for API requests.
These fields are now returned at all API endpoints by default.

The `id` field is the persisted UUID, the name field is the custom name
the user has passed in (defaulted to the hostname).

I renamed `node_uuid` and `node_name` to just `id` and `name` to be
inline with Elasticsearch.

This also fixed a broken test double in `webserver_spec.rb` that was
using doubles across threads which created hidden errors.

Fixes #6224
2016-11-09 07:40:47 -05:00
Colin Surprenant
e0ea02b045 fix tagging edge cases
add comment and use Arrays.asList()

brain fart between camelCase and snake_case
2016-11-04 14:13:13 -04:00
Tal Levy
6eef09de32 slowlog
Fixes #6128
2016-11-02 18:48:40 -04:00
Suyog Rao
53f7a64ccb Use stderr instead of puts
Fixes #6172
2016-11-02 15:52:00 -04:00
Suyog Rao
18a7d2fd27 Fix unit tests
Fixes #6172
2016-11-02 15:52:00 -04:00
Suyog Rao
22374fdefc Make logstash.yml optional
5.0.0 required Logstash to have a valid logstash.yml before it could start successfully. This
was mostly fine for users who installed Logstash via tar.gz, but many many folks who install
it via packages still start Logstash manually. Also, our documentation uses -e flag for
getting started on Logstash and sending their first event.logstash.yml has only defaults defined,
and there is no required parameter to start Logstash. We should be able to use the defaults if no
logstash.yml. Obviously, this is not ideal from a user point of view, so we should log a warning but
continue to bootstrap.

Fixes #6170

Fixes #6172
2016-11-02 15:51:59 -04:00
Pier-Hugues Pellerin
eca1d2705a This file isn't used all the observer logic is already handled in the periodic poller base class.
Fixes #6169
2016-11-02 14:08:27 -04:00
Pier-Hugues Pellerin
21b7a49148 Change how PeriodicPollers log their exception
In a busy logstash install and the way we interact with core stats from
the jvm or the os, the poller can timeout. This exception is logged as
an error. but this shouldn't impact normal operation.

This PR changes the following:

- Change the interval for 5s instead of 1s
- Make the timeout bigger 160s instead of 60
- Concurrent::TimeoutError will be logged using debug instead of error
- Any other exception will use the error level.
- add tests

Fixes: #6160
Fixes: #6158

Fixes #6169
2016-11-02 14:08:27 -04:00
Suyog Rao
de5c23cb0a -e and -f should merge even without valid conf file
Previously if both -e and -f was specified, LS required that
-f still have valid config file(s) before merging. This fixes it
to either have one of -f or -e provided

Fixes #6164
2016-11-01 18:39:50 -07:00