Commit graph

10117 commits

Author SHA1 Message Date
andsel
2e4845df36 Introduction of conditional in jvm.options file (#12530)
- moved parsing of jvm.options file into Java code
- chnaged the parsing code to consider conditional notation to bind the applicability of certain JVM flags to specific JVM versions
- changed the launch scripts (.sh and .bat) to use the options string composition
- binded CMS flags to JVM specifications 8-14
2021-01-25 06:50:13 -08:00
andsel
b0c81338f3 Implements scripted log4j filters and appenders to Java, avoid usage of deprecated Javascript Nashorn (#12512)
- replaces all scripted filters with custom Java implementation
- implemented routing appender per pipeline in Java
- adapted log4j configuration shipped with Logstash
- print a warn message if it detects an scripted log4j configuration and continue the execution (#12591)
2021-01-25 05:46:27 -08:00
Joao Duarte
87297c5c7f [forwardport 7.x] Release notes for 7.10.2 (#12553) 2021-01-13 17:29:08 +00:00
Karol Bucek
53e73e9ccc
Fix: make sure LS exits when running into fatal errors (#12559)
Currently, LS does not respect fatal errors such as java.lang.OutOfMemoryError and continues executing.

This is dangerous since JVM errors are a legitimate reason to halt the process and not continue processing.

Additionally:

-   make sure we log the full stack-trace on fatal errors
-   halt the JVM wout executing finalizers/hook (scissors on how ES handles uncaught exceptions)
-   also, we should now be aware of a potentially unexpectedly dying thread

Back-port of #12470
2021-01-13 06:45:16 +01:00
andsel
98d3ac9d00 Moved ingest-converter tool from Javascript to Java, preserving the same behaviour (#12524)
(cherry picked from commit aa3576d74d)
2021-01-11 23:57:58 -08:00
Ry Biesemeyer
e2f2255fa5 pq: eliminate corruption by forcing version byte to be persisted
When the PQ creates a new page and allocates a memory-mapped buffer, the
underlying file is zero'd out to full page capacity and the version byte is
written to the buffer.

If Logstash crashes or is shut down before any elements have been pushed into
the queue page, we have no guarantees that the version marker has been
persisted to the storage device. A subsequent attempt to load an all-zeros
queue page will result in an obscure error message and failure to load:

~~~
AbstractPipelineExt - Logstash failed to create queue.
org.logstash.ackedqueue.io.MmapPageIOV2$PageIOInvalidVersionException: Expected page version=2 but found version=0
~~~

By sending `MappedByteBuffer#force()` immediately after the version has been
added to the buffer, we can shrink the window in which a crash can leave the
queue on disk in a corrupt state.
2021-01-11 18:35:19 +00:00
Karen Metts
c5941e6340
Doc: Add info on contributor program
Backports #12543 to 7.x
2021-01-04 16:09:59 -05:00
Rob Bavey
a5dbc8d2a2
Update license dependency information (#12544)
This commit updates the license information for the license dependency report.
Specifically, this adds a notice for racc, a different version of which is now
pulled in by nokogiri from the version included with jruby.
2021-01-04 15:59:21 -05:00
andsel
05ec149b39 Enable javadoc lint only for files that contains javadoc comments, avoid warning for missing javadoc comments on everything else
(cherry picked from commit d176e608bd)
2020-12-21 08:18:07 -08:00
Ry Biesemeyer
7704bc78d0
Bump 7.12 (#12525) 2020-12-16 06:59:28 -08:00
Ry Biesemeyer
8746cdeda4
plugin: adds :validate => :field_reference (#12459) (#12521)
* plugin: adds `:validate => :field_reference`

Provide plugins a way of validating that an input is a literal field-reference.

This is useful for input plugins that implement a `target` or other
non-interpolated directive, and allows these plugins to reject invalid
configuration before start-up instead of at run-time.

Plugins should not use this named validator directly, as doing so would cause
validation to fail with "Unknown validator" when the plugin is run on older
releases of Logstash. Instead, plugins should use the `validator_support`
adapter mixin that provides back-ports when necessary.

Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
2020-12-15 07:13:46 -08:00
andsel
06418b8631 Fix error due to missing variable when listitng tasks and no architecture is externally specified with -Pos_arch=
(cherry picked from commit 7144a3f7cf)
2020-12-10 07:09:11 -08:00
andsel
8550059a2a Forward port of 7.10.1 release notes to 7.x 2020-12-09 01:29:54 -08:00
Rob Bavey
0588d51056
[7x_backport] Add UBI8 image specific labels back to the docker image (#12502)
Clean backport of #12498

these labels are required for redhat openshift certification.

These commit reintroduces the labels for the ubi8 image only, and adds
acceptance tests to ensure these labels are correct and not inherited
2020-12-04 16:12:39 -05:00
Ry Biesemeyer
7457bc9038 REE: output reload interval as nanos instead of object
fixes a warning about an unsupported gauge type, matches the behaviour
on JEE.
2020-12-02 12:22:25 -08:00
andsel
8539d3fb9b Moved LogStash::Util::TimeValue to Java
(cherry picked from commit 1a62dc79e0)
2020-11-30 06:36:18 -08:00
andsel
872d25b9f6 Moved ModulesSettingArray from Ruby to Java.
The ModulesSettingArray is responsible to obfuscate password in arrays of settings.
The test are still in Ruby to proove the interoperability with Ruby code that used the previous version.

Added method to mimic .first and .last methods of Ruby Array

(cherry picked from commit fa3891953d)
2020-11-30 03:04:56 -08:00
andsel
f50cc38ea6 [Doc] expanded the description of how to obtain the logger's names form Java and Ruby class names
(cherry picked from commit 7db4692044)
2020-11-25 23:45:36 -08:00
andsel
fee5c72022 Fix an API break, a Ruby's ArgumentError should be raised.
Reestablished Ruby specs to test moved code.

(cherry picked from commit 09f995776e)
2020-11-25 03:07:43 -08:00
andsel
e9aabdc3f1 Fix an API break in CloudSettingsAuth, a Ruby's ArgumentError should be raised.
Bring back Ruby specs to double check the change also in Ruby context.

(cherry picked from commit 14570d5d86)
2020-11-25 02:32:48 -08:00
Colin Surprenant
45099c1b54 remove evaluation dir from JRuby bundled did_you_mean gem 2020-11-23 19:22:28 +00:00
andsel
f37d9a462c Drop Password Ruby class to use only the Java version
There is two Password classes that almost does the same thing. One in Ruby (LogStash::Util::Password) and one in Java (co.elastic.logstash.api.Password).
This commit drop the the Ruby implementation to import the Java version in the LogStash::Util so that existing Ruby code haven't to be changed, works as it is.

(cherry picked from commit ca81a8f4a3)
2020-11-19 08:57:51 -08:00
andsel
747c38d6db Move code of CloudSettingAuth to Java
- moved the class's code
- moved spec tests to JUnit tests

(cherry picked from commit b0920eb6ff)
2020-11-18 23:50:31 -08:00
Rob Bavey
44fa849852
[7x backport] Fix docker image metadata (#12450)
Clean backport of #12447, #12452

This commit fixes two issues with the docker metadata:

Removes non-OCI compliant freeform metadata labels
Uses a consistent build date for all the docker images and dockerfiles

Additionally, this commit adds a `build_docker_ubi8` rake task to enable
`ci/docker_acceptance_tests.sh` to run with no options to build all
docker images for the architecture.

Removing the freeform description labels left the container metadata
without a description label. This commit adds a description under the
"org.opencontainers.image.description" label
2020-11-18 16:10:48 -05:00
andsel
b1e5c4f257 Moved CloudSettingId class and tests to Java
(cherry picked from commit 2545fa45ba)
2020-11-16 00:36:16 -08:00
Karen Metts
cf7e2e308e
[Forward] Doc:Release notes 7.10.0 to 7.x (#12433)
Co-authored-by: andsel <selva.andre@gmail.com>
2020-11-12 14:02:30 -05:00
andsel
88ceb5ccfc Added console prints in ingest-converter for not recognized processor definitions.
Adds console output for
- 'if' condition in 'set' processor
- unrecognized processor, like join

(cherry picked from commit 690bade81f)
2020-11-10 23:58:15 -08:00
Rob Bavey
68f9ba899c
[7x backport] Add more information to UnexpectedTypeException (#12429)
Clean backport of #12426

Where available, this commit adds information from getSourceWithMetadata to the
error message of UnexpectedTypeException, dropping down to `toString`
if not, giving more context to find where the issue is caused in the configuration.
2020-11-10 10:35:29 -05:00
kaisecheng
aba562e887
[backport 7x] hash function of pipeline config with metadata (#12425)
add metadata in the hash function

Fixed #12387
2020-11-09 15:36:50 +01:00
kaisecheng
1ea4837b71
[backport 7x] delete pipeline in registry (#12419)
deletes the pipeline in the pipelines_registry if it is terminated and is removed in the source

Fixed: #12414
2020-11-09 13:21:40 +01:00
Karen Metts
5037fd23e9
[Backport] Doc: Add bundled JDK info (#12417)
Document options and impacts of bundled JDK

Backports: #12369
2020-11-05 12:45:57 -05:00
kaisecheng
d473e0b7cf
[backport 7x] Doc: wildcards in xpack.management.pipeline.id (#12416)
Backports: #12396
Fixes: #12366
2020-11-05 17:34:14 +01:00
Rob Bavey
92f304a132
[7.x backport] Add addresses to p2pipeline input and output plugin metrics (#12413)
Clean backport of #12394

This commit adds context to the pipeline to pipeline input and output
plugins by adding a string containing the `address` field to the input
plugin, and an array containing the `send_to` field to the output plugin.
This helps gain a picture of how pipeline to pipeline enabled configurations
are communicating with each other, without having to refer back to the pipeline
definition
2020-11-04 16:09:22 -05:00
kaisecheng
958ffa71f0
add wildcard support in xpack pipeline id (#12370) (#12407)
add wildcard support in xpack pipeline id
do the pattern matching with glob
add warning msg to wildcard with legacy api
check invalid pipeline in bootstrap
test cases for invalid checking

Fixed: #10558
2020-11-03 18:51:52 +01:00
Karen Metts
54505a9b41
[Backport]Doc:Restructure troubleshooting docs and add plugin tracing (#12405)
Restructures troubleshooting docs in preparation for expanding content
Adds info for plugin tracing to help users track down plugins that might be causing problems

Co-authored-by: João Duarte jsvd@users.noreply.github.com

Backports: #12270
Fixes: #12228
2020-11-02 16:28:06 -05:00
Karen Metts
50428785cf
[Backport][Doc]Relocate logstash-to-cloud info for increased visibility (#12400)
Moves Cloud info to Configuration section to make it more obvious and easier to find
Expands content for using cloud id and cloud auth outside of modules
Moves module-specific info into modules section

Backports #11884 to 7.x
2020-10-30 16:23:58 -04:00
kaisecheng
c96543b010
[7x backport] document system indices api privilege (#12393)
backport #12388 #12391
2020-10-29 09:49:52 +01:00
Rob Bavey
a02b7e13c5
[7x backport] Update jrjackon and databind versions
Clean backport of #12385
2020-10-26 15:00:26 -04:00
andsel
350bb28b06 In QA test, when Logstash package with bundled JDK is installed on RedHat it has to check also the architecture
(cherry picked from commit a6fbc6c260)
2020-10-21 08:58:53 -07:00
andsel
582f886276 Forward of 7.9.3 release notes 2020-10-21 07:58:35 -07:00
Rob Bavey
bf1238dec2
[7x backport] Add optional sourceURL to license report CSV (#12362)
Clean backport of #12346

This commit adds an extra optional column 'sourceURL' to the license report. This
column contains a pointer to the source code, which is optional for most dependencies,
but a requirement for some, such as the Red Hat Universal Base Image.

This commit also populates the 'copyright' field, which previously was an used
column in the CSV definition

Relates #12297
2020-10-20 11:00:05 -04:00
Karol Bucek
a693fa3bf4
Build: properly isolate integration (test) env setup (#12364)
to avoid gems being resolved from the usual LS GEM_HOME

this is problematic for gems such as jruby-openssl which are loaded
during boot (by RGs/Bundler) and thus activated in Bundler from a
different GEM_HOME. if such gem is updated it won't end up being
install-ed in the --path location as it's found on the GEM_HOME!

+ Fix: gem conflict 1.3.6 required by core
this is due now isolating GEM_HOME on `bundle install --path`

+ Refactor: we do not need LS_GEM_HOME/PATH

+ avoid pinning jruby-openssl to 0.10.4

resolves GH-12299 (reverting GH-12301)
2020-10-20 09:00:01 +02:00
Rob Bavey
0727260c71
[7x backport] Handle Windows delete pending files (#12337)
Clean backport of #12335

When deleting temporary files created by the DLQ writer to store data before moving to their
final location, Windows may leave these files in a "delete pending" state, where the files
are somewhat in a state of limbo, where they result of `Files.exist(filename)` is `false`,
but the result of `filename.toFile().exists()` is true. When files are in this state, a new
file with the same name cannot be created, which causes the DLQ test used to ensure that
closing and reopening the DLQ (in such events as a pipeline restart) to fail.

This commit moves the temporary file to an alternative location before deletion, ensuring that
the "pending delete" status does not interrupt with the DLQ startup
2020-10-13 17:11:58 -04:00
Colin Surprenant
69e6200a7b
stop inputs upon a worker error before terminating the pipeline (#12342)
This addresses an incomplete fix in #12019 starting in 7.8.1 where upon catching a worker exception (to avoid crashing the whole logstash per #12306) the input plugin(s) are not terminated prior to closing the pipeline leading to the input plugin(s) continuing execution and failing with IllegalStateException & Tried to write to a closed queue since closing the pipeline also correctly closes the queue.
2020-10-13 17:06:25 -04:00
Karen Metts
0b18b79cce
Doc: Clarify use of queue max bytes setting (#12341)
Queue max bytes only applies to persistent queues
Forwardports: #12334 to 7.x

Co-authored-by: rsdrakh <33121848+rsdrakh@users.noreply.github.com>
2020-10-13 15:38:15 -04:00
Rob Bavey
80db07d36d
[7x backport] env2yaml syntax error (#12322)
Clean backport of #12320

`pipeline.ecs_compatibility` setting was missing a comma after its definition
2020-10-07 14:46:53 -04:00
Rob Bavey
708c156c1b
[7x backport] Write DLQ entries to temp file first (#12304) (#12318)
Clean backport of #12304

This commit changes the DLQ writer to write to a temporary file
 which will be renamed on "completion", to avoid the possibility
 of the DLQ reader reading an incomplete DLQ segment. The temp file
 will be renamed and made available, either when the capacity of this
 segment is reached, or if a configurable 'flush interval' has elapsed
 since the last event reached the dead letter queue.

This commit fixes #8022, #10275, #10967
This commit replaces #11127
2020-10-07 14:37:49 -04:00
Rob Bavey
a6a31ec428
[7x backport] Remove redundant shouldRunAfter (#12316)
Clean backport of #12314

The `shouldRunAfter` specified in the main script body was causing the runIntegrationTests
task to be evaluated even when it should not have been, causing unnecessary failures
when artifacts required only for integration tests are unavailable.
This can be removed, because the `shouldRunAfter` relationship for the `runIntegrationTests`
task is already defined in the task body.
2020-10-07 11:38:50 -04:00
andsel
5ad7bbb03b Bump 7.11 2020-10-07 06:11:55 -07:00
kaisecheng
a93d454688 replace direct access of hidden indices with system indices api (#12279)
* replace direct hidden indices access with system indices api

* fulfill backward compatibility

* fix log msg, rename class, simplify response handling

* modularise fetcher
2020-10-06 21:27:28 +02:00