Commit graph

10117 commits

Author SHA1 Message Date
Ry Biesemeyer
c606e9f5b1
ECS Compatibility 7.x Backport (#12308)
Implements a plugin `ecs_compatibility` option, whose default value is powered
by the pipeline-level setting `pipeline.ecs_compatibility`, in line with the
proposal in elastic/logstash#11623:

In order to increase the confidence a user has when upgrading Logstash, this
implementation uses the deprecation logger to warn when `ecs_compatibility` is
used without an explicit directive.

For now, as we continue to add ECS Compatibility Modes, an opting into a
specific ECS Compatibility mode at a pipeline level is considered a BETA
feature. All plugins using the [ECS Compatibility Support][] adapter will
use the setting correctly, but pipelines configured in this way do not
guarantee consistent behaviour across minor versions of Logstash or the
plugins it bundles (e.g., upgraded plugins that have newly-implemented an ECS
Compatibility mode will use the pipeline-level setting as a default, causing
them to potentially behave differently after the upgrade).

This change-set also includes a significant amount of work within the
`PluginFactory`, which allows us to ensure that pipeline-level settings are
available to a Logstash plugin _before_ its `initialize` is executed,
including the maintaining of context for codecs that are routinely cloned.

* JEE: instantiate codecs only once
* PluginFactory: use passed FilterDelegator class
* PluginFactory: require engine name in init
* NOOP: remove useless secondary plugin factory interface
* PluginFactory: simplify, compute java args only when necessary
* PluginFactory: accept explicit id when vertex unavailable
* PluginFactory: make source optional, args required
* PluginFactory: threadsafe refactor of id duplicate tracking
* PluginFactory: make id extraction/geration more abstract/understandable
* PluginFactory: extract or generate ID when source not available
* PluginFactory: inject ExecutionContext before initializing plugins
* Codec: propagate execution_context and metric to clones
* Plugin: intercept string-specified codecs and propagate execution_context
* Plugin: implement `ecs_compatibility` for all plugins
* Plugin: deprecate use of `Config::Mixin::DSL::validate_value(String, :codec)`
2020-10-06 08:33:11 -07:00
Rob Bavey
ccbc5691cb
Docker Build: Add ability to detect/set build architecture (#12303)
Clean backport of #12302

This commit adds the ability for the docker build to build artifacts for multiple architectures.
By default, the target architecture is inferred from the architecture of the machine the build is being
run from - running the build from an aarch64 machine will build an aarch64 docker image, while building
from an x86_64 machine will build an x86_64 docker image.

This can be overridden by setting the environment variable DOCKER_ARCHITECTURE to either `x86_64` or
`aarch64`.

This commit also updates the integration tests to test against the architecture from the machine the test
is being run on, and includes the target architecture in the test description.
2020-10-05 13:38:09 -04:00
Rob Bavey
19d8a170e0
fix dependency issue, jruby-openssl, of integration test (#12301)
Backport of #12300

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
2020-10-05 09:03:35 -04:00
Rob Bavey
23141e8f7e
Add RedHat Univeral Base Image license information (#12296)
Clean backport of #12287
2020-10-02 15:47:25 -04:00
Rob Bavey
97028a0320
Update license information (#12294)
Generate new notice file
2020-10-01 09:34:00 -04:00
andsel
9668b9ec5c Bundle JDK (AdoptOpenJDK 11) in Logstash artifacts (ARM64)
Changed Linux creation artifacts (tar.gz/deb/rpm) to include the ARM JDK.
Extracted common parts of artifact.rake into functions to be shared between ARM and Intel bundling tasks
2020-09-30 05:59:29 -07:00
Rob Bavey
813e059a9d Bundle JDK (AdoptOpenJDK 11) in Logstash artifacts (x86_64)
Create new artifacts with bundled JDK for the supported platforms on x86_64. Download JDK packages from AdoptOpenJDK site, the selected version is loaded from `versions.yml`.
Changed also the launch scripts to give precedence to JAVA_HOME, then fallback on bundled JDK if present, as last resource go to the system Java.

New artifacts produced with bundled JDK are:
- tar.gz with JDK for Linux and Darwin
- zip file for Windows
- dep and rpm
- Docker image

All artifacts without JDK are now postfixed with '-no-jdk' while the ones with JDK included has the architecture extension.

Covered with tests the touched parts

Co-authored-by: Rob Bavey <robbavey@users.noreply.github.com>
2020-09-30 05:44:42 -07:00
Karen Metts
f9f998313e
Doc:Increase visibility of offline plugin support (#12283) (#12284)
Elevates visibility of Offline Plugin Management section so that air gapped users
don't have to struggle through instructions that require an internet connection.

Backports: #12283
Related: #12280
2020-09-29 17:20:21 -04:00
Rob Bavey
16e0f85af8
7.9.2 Release Notes (#12272)
* Add JDK 15 compatibility notice
* Add more information to app_search missed dependency fixed issue

Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
2020-09-24 10:41:27 -04:00
Karen Metts
b287ec72e2
Doc:Clarify how Bulk API interacts with DLQ (#12209) (#12268)
Documents both HTTP success and HTTP failure scenarios.
Co-authored-by: Ry Biesemeyer <ry.biesemeyer@elastic.co>

Backports #12209
2020-09-23 14:10:18 -04:00
Rob Bavey
9472d89363
[7x backport] Update ubi8-minimal to pull from elastic docker registry (#12258)
Clean backport of #12253
2020-09-22 14:19:48 -04:00
andsel
d792d4dd43 Added elastic-app-search and jwt license definition and notices 2020-09-17 09:39:09 +00:00
Rob Bavey
1684c8529f
[7x backport]Fix docker image certification (#12248)
Clean backport of #12242

This commit includes the required changes to pass RedHat docker image certification.
This includes:
 Moving license files to /licenses folder
 Adding required base labels for name, description, vendor and summary

Relates: https://github.com/elastic/dev/issues/1287
2020-09-16 09:13:58 -04:00
Karen Metts
2fb348e053
[DOC] Logging settings can affect performances (#12246) (#12247)
Logging settings can affect performances
Backports #12246 to 7.x branch

Co-authored-by: Luca Belluccini <luca.belluccini@elastic.co>
2020-09-15 16:51:29 -04:00
Karen Metts
1f345a2653
Doc:Forwardport Release notes 7.9.1 to 7.x (#12240)
* Release notes for 7.9.1 (#12220)
* Doc:Fix release notes formatting for consistency (#12224)

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
2020-09-14 16:45:09 -04:00
Rob Bavey
68ac9477d5
[7.x backport] Fix keystore thread safety (#12235)
Clean backport of #12233

This commit is intended to fix thread safety issues with the  JavaKeystore implementation of the secret store.
From reading the code, it appears that thread safety for the keystore was intended to be provided by
a ReentrantReadWriteLock, a read lock for accessing secrets from the keystore, and a write lock for updating
secrets in the keystore.

In practice, this was insufficient, the act of accessing a secret from the keystore involved the mutation of
a shared keyStore object - the keyStore is `load`ed every time a secret is retrieved from the store.

Previous to https://github.com/elastic/logstash/pull/10794, this did not matter, each pipeline held its
own instance of the secret store, effectively meaning that only a single thread would ever access a key
store at any one time. This PR moved to using a shared keystore instance for substitution variables,
exposing the lack of thread safety in the JavaKeystore class.

This commit is intended to be the simplest change to fix the underlying issue, and does not address whether
we *need* to reload the secrets every time they are read.

Relates #12229
2020-09-11 14:26:43 -04:00
andsel
c0d9b025e5 Fix to implement the blank? method that doesn't exists for String, is added by Rails framework 2020-09-04 14:29:03 +00:00
Karen Metts
07e8400f27
Doc:Add redirect from multiline filter to multiline codec (#12208) (#12217)
Add filebeat module use case

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2020-09-02 11:49:55 -04:00
Colin Surprenant
c1dc474868 fix flushing upon empty batches with ordered execution
when running a pipeline with ordered execution, flushes on the pipeline
were no longer being called when compute is called with an empty batch, causing
issues with the aggregate filter, for example, not being able to push events on
timeout.
2020-08-26 19:07:00 +00:00
Rob Bavey
ad631e464e Add test for ordered pipeline flushing fix 2020-08-26 19:07:00 +00:00
Julien Mailleret
713fbfbf14 fix ubi8 docker build context
This commit fixes a typo in the name of the docker build context for ubi8 images.
2020-08-26 15:16:50 +00:00
Andres Rodriguez
a755eb5470 Docker: Expose xpack.management.elasticsearch.proxy (#12201)
Expose the proxy xpack management proxy setting in docker (xpack.management.elasticsearch.proxy).
Also surface the same proxy setting in the sample config.
2020-08-25 13:18:01 -07:00
Colin Surprenant
75411cfe0b ensure input plugin close is called upon termination or pipeline reload 2020-08-21 15:08:20 +00:00
Drew Boswell
4ef0204098 add ssl verification_mode to env2yaml 2020-08-21 14:28:12 +00:00
Karen Metts
0fd5d3a032 Doc:Add note that stdin input doesn't allow config reloading 2020-08-20 22:15:32 +00:00
Rob Bavey
7b8335c542 Limit locale changes to ubi8 container 2020-08-20 14:35:48 +00:00
Rob Bavey
0772e72fa8 Minor fixes to acceptance and docker test scripts 2020-08-20 14:35:48 +00:00
Rob Bavey
ef1352ef53 Add UBI8 docker image to artifacts
This commit adds the rake docker_ubi8 rake task, and associated
changes to the docker template and makefiles.

This commit also refactors the acceptance tests to extract xpack tests
into a helper class to allow the same tests to be used in both 'full'
and 'ubi8' docker image tests
2020-08-20 14:35:48 +00:00
Karen Metts
7637fa3f37
Release notes 7.9.0 (#12179) (#12188)
Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2020-08-18 15:52:58 -04:00
Ry Biesemeyer
854a31756e lir: inject newline delimiter only when necessary
Our internal representation of the composite config file needs only to inject
newline delimiters if they are missing, and to avoid doing so if they are
present. This allows `PipelineConfig#sourceReferences()`, used to map back from
the composite line/column to source file/column, to correctly track an offset
using the source fragments `SourceWithMetadata#getLinesCount()`.

Fixes: #12155
2020-08-06 18:11:47 +00:00
Ry Biesemeyer
b2961deaee test: no-op refactor to avoid repeating implementation in test 2020-08-06 18:11:47 +00:00
Ry Biesemeyer
6f421e56da perf: fix memoization of PipelineConfig#configString() 2020-08-06 18:11:47 +00:00
Joao Duarte
1013a80b38 allow skipping pr creation in version bump script 2020-08-06 15:15:09 +00:00
Karen Metts
762d48e312 Doc:Adjust link for integration plugin header file 2020-08-06 14:16:01 +00:00
Joao Duarte
f736d9c860 bump jruby to 9.2.13.0 2020-08-05 14:49:21 +00:00
Ry Biesemeyer
04a3852428 specs: don't start ES connection pool when only validating config
Accidentally succeeding at connecting to an HTTP resource that is not a real,
live Elasticsearch (such as an Elastic Cloud instance that has been shut down
and reaped) can cause client initialization to fail.
2020-08-04 09:24:59 +00:00
Karen Metts
2c9cf09e88 Doc:Fix name of monitoring settings 2020-08-04 00:21:18 +00:00
Rob Bavey
e8385738c5
7x Introduce integration tests for docker images (#12157)
Clean backport of #12135

This commit adds integration tests for the Logstash docker images. Previous
integration tests were removed in https://github.com/elastic/logstash/pull/10693,
due to the tests being non functional.

The commit adds image and container tests. The image tests check the contents and the
metadata of the image; the container tests check the logstash process, and includes tests
ensuring that logstash runs, and is configurable.

This test also adds a ci script to allow the tests to be run on jenkins, and to split the
running of these tests up based on the image type and includes updates to the rake tasks to
support this.
2020-08-03 09:43:09 -04:00
Karen Metts
2e7ba7b417 Doc:Add monitoring and management to API key security content 2020-07-31 22:21:43 +00:00
andsel
7df59fbe76 Remove settings that was intended to direct ship monitoring data to ES monitoring cluster
During the development of PR #11541 to direct ship monitoring data to an monitoring ES cluster without hopping through a production ES cluster, the settings for elasticsearch ouput was cloned into a version without the `xpack` prefix.
Since that feature has been removed the settings should also be removed from the Docker image
2020-07-30 09:22:28 +00:00
andsel
dcca6c2c61 Expose xpack.monitoring.elasticsearch.proxy setting as Docker env variable
In PR #11799 we missed to add the exposure of proxy also as docker env variable so that uses can connect the dockerzied Logstash to a proxed monitoring cluster
2020-07-30 09:21:38 +00:00
Karen Metts
2aa5cadd44 Doc:Fix link to monitoring docs and tag optional features 2020-07-29 23:31:52 +00:00
Ry Biesemeyer
dbf43f9bd9 reword bin/system_install help text to be less confusing.
Present OPTIONSFILE search in a way that reads first-match-wins, since that is
what actually happens.

Resolves: #12145
2020-07-27 21:21:55 +00:00
Karen Metts
69ba072ef3
Doc:Forwardport 7.8.1 release notes (#12092) to 7.x #12142
Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
Co-authored-by: Colin Surprenant <colin.surprenant@gmail.com>
2020-07-27 14:47:55 -04:00
Rob Bavey
702f872eff Fix docker image labels
Prior to this commit, the value of `org.label-schema.license` and
the values in `org.opencontainers.image.*` were not set, and therefore
would be inherited from the base OS image.
2020-07-23 19:48:58 +00:00
Joao Duarte
e7db1ae16c initial introduction of .fossa.yml
Although fossa has a fossa init tool to auto discover dependencies,
it doesn't work well for Logstash.

The mix of JRuby and Java allows for correct gradle detection but for
Ruby we tell FOSSA to look at the lockfile, which we generate using
ci/bootstrap_dependencies.sh

This is a work in progress and covers 99% of our dependencies.
As we get comfortable we'll have to uncomment a few ruby subprojects
contained in the logstash source tree.
2020-07-23 08:38:06 +00:00
João Duarte
d78635ca4f Document use of keystore values in pipelines.yml 2020-07-22 20:43:56 +00:00
Karen Metts
3135831538 Doc:Create a new header for integration plugins
Integration plugins need a different header. For example, the plugin docs should
to point to the integration repo rather than the input, output, filter, or codec
repo. The new header also includes boilerplate text to indicate that the individual
plugin is part of an integration rather than stand-alone. This work implements needed
changes.
2020-07-20 19:23:34 +00:00
Karen Metts
6546bb3ba5
Doc:Fine tune 7.8 release notes (#12122)
Forwardport 7.8.0 release notes updates from #12050 to 7.x branch
2020-07-17 20:31:43 -04:00
Joao Duarte
dc412713ef add ci script setup dependencies
This script can be useful for preparing the environment for
services like code scanners.
2020-07-16 09:09:53 +00:00