Commit graph

124 commits

Author SHA1 Message Date
João Duarte
0d127737aa
reinstate x-pack.monitoring settings in logstash.yml (#11822) 2020-04-22 15:28:47 +01:00
Ry Biesemeyer
de5888ba18 API: avoid starting webserver when http.enabled=false
In some workflows such as simple file manipulation, starting a webserver is
unnecessary overhead, and we should be able to avoid it.

Here we introduce a new parameter `http.enabled`, which defaults to `true` to
maintain the existing functionality.

Resolves: elastic/logstash#9408
Closes: elastic/logstash#11525

Co-authored-by: Benoit Dupont <benoit.dupont@gmail.com>

Fixes #11533
2020-04-21 20:08:46 +00:00
Karen Metts
13ae7bb03a
[Doc]Note that unit qualifier is required for config.reload.interval (#11771)
* Note that unit qualifier is required for config.reload.interval

* Update description in logstash.yml
2020-04-13 14:48:03 -04:00
andsel
3695580b92 Adaptations to internal collector to send data directly to monitoring cluster Close 11573
Fixes #11541
2020-02-28 14:26:19 +00:00
Colin Surprenant
0bc9fa5665
add support for pipeline.ordered setting for java execution (#11524)
reuse rubyArray for single element batches

rename preserveBatchOrder to preserveEventOrder

allow boolean and string values for the pipeline.ordered setting, reorg validation

update docs

yml typo

Update docs/static/running-logstash-command-line.asciidoc

Co-Authored-By: Karen Metts <35154725+karenzone@users.noreply.github.com>

Update docs/static/running-logstash-command-line.asciidoc

Co-Authored-By: Karen Metts <35154725+karenzone@users.noreply.github.com>

java execution specs and spec support

docs corrections per review

typo

close not shutdown

Ruby pipeline spec
2020-01-29 14:01:38 -05:00
andsel
6eb25173e0 Added plugin.id to fish tag log lines related to plugins
Fixes #11078
2020-01-23 15:33:31 +00:00
Karol Bucek
d8398351a2
Feat: x-pack cloud id/auth for monitoring/management (#11496)
resolves #11488
2020-01-14 22:06:50 +01:00
andsel
f554930e81 Introduced DeprecationLogger for use in core code and exposed to Java and Ruby plugins. Closes 11049
Fixes #11260
2019-11-14 10:49:27 +00:00
andsel
4621a0a798 Fix to avoid Nashorn error regarding the unknown flag --no-deprecation-warning for JDK < 11. closes 11221
Fixes #11225
2019-10-17 10:46:23 +00:00
João Duarte
ec16c49741 remove 10k character truncation from log4j2.properties
Quite often we see log entries that are truncated by this limit since java stack traces can be very verbose.

This prevents us from seeing the real issue and require us to ask for users to remove the limitation and trigger the issue again so we can see the full problem.

This commit removes this truncation.

Fixes #11206
2019-10-10 10:28:24 +00:00
andsel
e58a6e01ce Added LS configuration variable 'pipeline.separate_logs' to separate logs per pipelines - use log4j RoutingAppender - avoid output to main log files when log per pipeline is enabled - closes 10427
Fixes #11108
2019-10-08 14:07:17 +00:00
andsel
cda592f659 Add pipeline.id to log lines
fixes #8290, #10521
2019-08-28 17:57:28 +02:00
Colin Surprenant
696323f26a make sure joni regexp interruptability is enabled
Fixes #10978
2019-07-22 16:22:32 +00:00
Colin Surprenant
6990d08be5
rename config option .url and .ca to .hosts and .certificate_authority (#10380) 2019-02-05 17:39:30 -05:00
Ry Biesemeyer
583ec6b625
Java 11 support (#10279)
* bump jruby to 9.2

* don't rely on logstash-base docker image

* work around webmock ruby 2.5 support

* ensure data folder exists in docker

* change fixnum and bignum to integer

* FileUtils.rmdir to rm_rf

this is because from 2.3 to 2.5 FileUtils.rmdir will throw an exception
if the directory isn't empty. On 2.3 the operation will just not delete
the directory silently.

* bump jruby to 9.2.5.0 and fix test

* make rake default task since prepare pack needs it

* Resolve compiler warnings (#10247)

There are 3 types of compiler warnings that are either resolved or suppressed:

1. Rawtypes: In JRuby 9.2, `RubyArray` is a generic, so references throughout
   our codebase to the now "raw" type trigger warnings. In most cases we cannot
   actually resolve the issue, since the JRuby-provided methods for creating
   `RubyArray`s still return the raw type, so these have been suppressed.

2. Deprecations:
   - `RubyString#intern19()` -> `RubyString#intern()`
   - `RubyString#downcase19(ThreadContext)` -> `RubyString#downcase(ThreadContext)`
   - `NativeException`: remove import & reference directly; suppress usage
     warnings
   - `RaiseException()`: migrate to equivalent non-deprecated methods wherever
     possible; in some cases where we are using this in conjunction with the
     also-deprecated `NativeException` to preserve java stacktraces, there
     seems to be no non-deprecated path forward, so these cases have been
     suppressed.

3. Redundant Casts
   - Resolved

* JRuby 9.2 bundler shenanigans (#10266)

* Revert "Revert "remove forced dependency on old bundler (#9395)""

This reverts commit bef984143d.

* plugin management: update internal bundler to 1.17.x APIs

* deps: update dev dependency webmock to version compatible with JRuby 9.2

* spec: update Pack fixture to include manticore version that doesn't conflict

* build: update gradle to version that has Java 11 support

* java11: resolve or suppress deprecation warnings

* Remove superfluous flag opting into ParNew GC implementation

When opting into CMS garbage collector with `XX:+UseConcMarkSweepGC`, the
young generation collector ParNew has been the default since Java 8, making
the `XX:+UseParNew` flag redundant; the flag was removed in Java 9, and
should no longer be specified to work with modern Javas.

https://bugs.openjdk.java.net/browse/JDK-8006478
https://openjdk.java.net/jeps/214

* spec: set thread name to example description for easier debugging

* spec: prevent errors in testing specs by checking against skip list before using

* no-op: remove use of `HashMap#computeIfAbsent` on single-threaded code

> This method will, on a best-effort basis, throw a `ConcurrentModificationException`
> if it is detected that the mapping function modifies this map during computation.
>
> -- https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/HashMap.html#computeIfAbsent(K,java.util.function.Function)

* qa: by default, run integration against Elastic Stack 6.5.x

To support development on Logstash on top of Java 11, default to testing
against an Elastic Stack that is capable of running on Java 11.

* qa: ignore deprecation warnings when comparing offline pack output

* qa: add Java 9+ support to ChildProcess dev dependency

this can safely be removed when the childprocess gem supports Java9+
https://github.com/enkessler/childprocess/pull/141

* qa: allow connections to localhost in webmock

* bump jrjackson version

* fix filebeat integration tests

* spec: ensure license compliance spec runs first

The license compliance spec that validates the licenses of bundled
plugins appears to not be compatible with the hooks that we inject
into bundler for plugin management, and will fail in obscure ways
when run after those hooks have been added. Since those hooks are
not necessary for validating licenses, the easiest solution was to
ensure that those specs run first, before the VM has been poluted.

Since the gradle/junit/rspec bridge that is currently in place
runs all specs in the same JVM, we also need to make sure that the
rspec "world" is reset before a run, to ensure that it doesn't
retain spec definitions from previous runs.

Also updates the rake invocation, although I'm not sure it is used
any more.
2019-02-04 16:36:11 -08:00
João Duarte
25e773556c
remove pipeline output workers setting (#10358) 2019-01-30 10:09:15 +00:00
João Duarte
fe7607abd4
only start monitoring pipeline after valid license (#10106)
Avoid unecessary logging errors and resource usage by only starting
the monitoring pipeline if we can validate the license.
2018-11-07 17:28:48 +00:00
Guy Boertje
3fdee027d9
Add SC and EB input TLS support for the Logstash ArcSight module (#10056)
* Add SC and EB input TLS support for the Logstash ArcSight module
I added the ssl for the smart connector (tcp) and ssl and sasl for the
event broker.
Needs verification on a current stack.

* So this is the actual extent of changes (I thought it was to simple)
Fixed the docs omission
Fixed the load path issue
Fixed the ERB binding context problem
Added some basic happy path tests

* remove module settings in logstash.yml

* Overwrite my logstash.yml with the content on master

* Add comments to yaml fixtures
2018-10-23 09:12:12 +01:00
Joao Duarte
78bc47d1c9 support ssl verification mode in monitoring and management
Fixes #9866
2018-08-31 08:01:27 +00:00
Josh Soref
c6cd247ec3 Multiple spelling corrections (#9782)
* spelling: actually
* spelling: already
* spelling: concurrency
* spelling: constructor
* spelling: destinations
* spelling: different
* spelling: elasticsearch
* spelling: encoding
* spelling: error
* spelling: explicitly
* spelling: failings
* spelling: falsey
* spelling: guarantees
* spelling: having
* spelling: implementation
* spelling: logstash
* spelling: module
* spelling: multiple
* spelling: omitted
* spelling: overridden
* spelling: pipeline
* spelling: raspberry
* spelling: receive
* spelling: recommended
* spelling: registered
* spelling: registering
* spelling: shutdown
* spelling: signal
* spelling: specified
* spelling: successful
* spelling: successfully
* spelling: valuefied
* spelling: vector
2018-07-04 10:41:10 +01:00
Tudor Golubenco
500271be39 Add sample configuration file
This adds a simple Logstash config sample that works as a standard
Beats -> Logstash -> Elasticsearch starting point.

It's being deployed in packages, typically under /etc/logstash/logstash-sample.conf

This also adds a Dockerfile that can be used to build the artifacts.

Fixes #9588
2018-05-17 19:58:35 +00:00
Jenkins CI
93cad10da1 Migrate x-pack-logstash source to logstash 2018-04-24 10:46:15 -05:00
Dan Hermann
e25aa0b845 Change the default LS_SETTINGS_DIR to /etc/logstash for service installations
Fixes #9304
2018-03-30 19:57:30 +00:00
Armin
53b9b7dbf9 #9292: Fix nested conditionals compiling incorrectly
Fixes #9294
2018-03-27 18:58:46 +00:00
Armin
8ee9a990cc PERFORMANCE: Avoid redundant dataset clear calls
Fixes #9294
2018-03-27 18:58:46 +00:00
DeDe Morton
93af85edb3 Remove pipeline.output.workers from logstash.yml
Fixes #8908
2018-01-04 21:02:02 +00:00
Shaunak Kashyap
a3f6da3c3a Allow users to specify --pipeline.id from the CLI
This will allow users to override the pipeline id from the default, "main", to something else while running pipelines via either the -e or -f options.

Fixes #8868
2017-12-20 20:17:36 +00:00
Dan Hermann
1ea1d1982d Add default log retention settings
Relates to #7842

Fixes #8815
2017-12-08 22:55:33 +00:00
Dan Hermann
6c84096a03 retain the 'log' extension
Fixes #8800
2017-12-07 17:18:55 +00:00
Dan Hermann
f1da660c1b Adds size cap for each individual log file. Compresses log files on rollover.
Fixes #7482.

Fixes #8800
2017-12-07 17:18:54 +00:00
Colin Surprenant
40827a53eb change batch delay to 50ms and page size to 64mb
a 50ms delay helps creating more full batches without practical added latency see #8707
a 64mb page helps PQ perfmance related to a large page size see #8702 #8707
2017-12-05 13:51:54 -05:00
Armin
97f1c49619 #8688 enable explicit System gc calls again to improve GC of DirectByteBuffer
Fixes #8776
2017-11-30 19:59:49 +00:00
Jake Landis
70dd05d88c Revert "Add jvm option ExitOnOutOfMemoryError"
This reverts commit a14fbfc3e2.

Fixes #8268
2017-09-15 13:55:02 +00:00
liketic
a14fbfc3e2 Add jvm option ExitOnOutOfMemoryError
Fixes #8138
2017-09-05 18:56:47 +00:00
Rob Bavey
b1b3a117a6 Add multi-pipeline test
Needs DRY-ing up before commit, but tests should be valid

Fixes #8026
2017-09-01 19:43:45 +00:00
Rob Bavey
6b1ffbc35e RATS: Dead Letter Queue integration tests (WIP)
Simple test for dead letter queue integration tests:
  Attempt to write invalid entries to elastic search, fail and
  remove invalid field. Verify that mutated entry exists in es

Not for committing - has different jvm.options to improve stability
  to ensure that the tests pass in CI.

Fixes #7882

Fixes #8026
2017-09-01 19:43:44 +00:00
Guy Boertje
c5f56e84d8 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:46:02 -07:00
Rob Bavey
75028f3592 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:19 +00:00
Armin
6c2a7da45b PERFORMANCE: Force JIT compilation, don't AOT compile
Fixes #7923
2017-08-07 16:55:01 +00:00
Armin
a1c067dd9a MINOR: Enable JRuby AOT compilation and turn JIT threshold down to 0
Fixes #7783
2017-07-24 21:34:41 +00:00
Armin
b6ebbb3eed MINOR: Set Xms == Xmx as a default
Fixes #7725
2017-07-18 17:08:29 +00:00
Armin
03e6f4d4a9 MINOR: default to -Djruby.compile.invokedynamic=true
Fixes #7698
2017-07-17 11:59:51 +00:00
Armin
deaa90e405 #6964 migrate setting config.reload.interval to TimeValue
Fixes #7678
2017-07-13 16:13:17 +00:00
Armin
4ceaa9f2e2 MINOR: Fix typo in logstash.yml config comment
Fixes #7659
2017-07-12 11:20:53 +00:00
Rob Bavey
af96fa36a5 Add dead_letter_queue.max_bytes setting
Add setting for dead_letter_queue.max_bytes to allow a user
to set the maximum possible size of a dead letter queue on disk.

Resolves #7633

Fixes #7638
2017-07-11 21:06:18 +00:00
Jordan Sissel
35c1cff164 Feature flag for string escape sequences (#7442)
New boolean setting `config.support_escapes` which defaults to false
(the historical behavior). When set to true, the following escapes are
handled:

* backslash doublequote -> doublequote
* backslash quote -> quote
* backslash n -> newline (ascii 10)
* backslash r -> carriage return (ascii 13)
* backslash backslash -> backslash
* backslash t -> tab (ascii 9)

This will solve #1645.
2017-06-20 14:34:10 -07:00
Pier-Hugues Pellerin
7b96c1a5da Small typo in the pipelines.yml (#7470)
The `config.string` option was not correctly closed with a double quote
2017-06-16 10:06:27 +01:00
Jordan Sissel
50cbaf4bf0 Set default entropy source to /dev/urandom
This changes the Java-wide from the default of /dev/random. The reason
for this chnage is that /dev/random can block if there is insufficient
entropy available, and this blocking can cause Logstash to stall on
startup for many many minutes.

Fixes #6117.

This scenario (no entropy) seems especially prone to occur on virtual
machines.

Related: https://github.com/jruby/jruby/wiki/Improving-startup-time#ensure-your-system-has-adequate-entropy

On Windows, I was not sure if this would work, but the JDK source tree
says this:

    On Windows systems, specifying the URLs "file:/dev/random" or
    "file:/dev/urandom" will enable the native Microsoft CryptoAPI seeding
    mechanism for SHA1PRNG.

So defaulting to /dev/urandom should still do the right thing on
Windows.

I also checked to see if other unix-likes had /dev/urandom, and
according to Wikipedia[1], Linux, FreeBSD, OpenBSD, OSX, Solaris,
NetBSD, and others all have urandom.

[1] https://en.wikipedia.org/wiki//dev/random

Fixes #7469
2017-06-15 17:44:34 +00: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
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