Commit graph

10928 commits

Author SHA1 Message Date
Victor Martinez
f0ae59aba5 mergify: add backport rules for 8.18 and 9.0 (#17168)
(cherry picked from commit c95430b586)

# Conflicts:
#	.mergify.yml
2025-03-05 07:58:27 +00:00
mergify[bot]
435ffcbadb
Improve warning for insufficient file resources for PQ max_bytes (#16656) (#17222)
This commit refactors the `PersistedQueueConfigValidator` class to provide a
more detailed, accurate and actionable warning when pipeline's PQ configs are at
risk of running out of disk space. See
https://github.com/elastic/logstash/issues/14839 for design considerations. The
highlights of the changes include accurately determining the free resources on a
filesystem disk and then providing a breakdown of the usage for each of the
paths configured for a queue.

(cherry picked from commit 062154494a)

Co-authored-by: Cas Donoghue <cas.donoghue@gmail.com>
2025-03-04 16:07:07 -08:00
github-actions[bot]
93f84cadd1
Update z_rubycheck.rake to no longer inject Xmx1g (#17211)
This allows the environment variable JRUBY_OPTS to be used for setting properties like Xmx
original pr: #16420

(cherry picked from commit f562f37df2)

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
2025-03-04 14:06:00 +00:00
mergify[bot]
bb6ffd0b6a
Fix empty node stats pipelines (#17185) (#17197)
Fixed an issue where the `/_node/stats` API displayed empty pipeline metrics
when X-Pack monitoring was enabled

(cherry picked from commit 86785815bd)

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
2025-02-28 22:52:41 +00:00
João Duarte
18772dd25a
Update Dockerfile.erb to set eux on RUN command with semicolons (#17141)
as per guidance https://github.com/elastic/logstash/pull/16063#discussion_r1577000627
2025-02-28 17:53:59 +00:00
github-actions[bot]
772ce894cb
plugin manager: add --no-expand flag for list command (#17124) (#17170)
* plugin manager: add --no-expand flag for list command

Allows us to avoid expanding aliases and integration plugins

* spec: escape expected output in regexp

(cherry picked from commit 793e8c0b45)

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
2025-02-27 14:33:51 -08:00
github-actions[bot]
32463efdba
qa: don't bypass plugin manger tests on linux (#17171) (#17173)
* qa: don't bypass plugin manger tests on linux

* add gradle task to build gem fixtures for integration tests

(cherry picked from commit 0f81816311)

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
2025-02-27 14:01:49 -08:00
github-actions[bot]
7fec532924
Add Windows 2025 to CI (#17133) (#17143)
This commit adds Windows 2025 to the Windows JDK matrix and exhaustive tests pipelines.

(cherry picked from commit 4d52b7258d)

Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
2025-02-24 16:49:19 +02:00
github-actions[bot]
247f73b76a
Update container acceptance tests with stdout/stderr changes (#17138) (#17140)
In https://github.com/elastic/logstash/pull/17125 jvm setup was redirected to
stderr to avoid polluting stdout. This test was actually having to do some
additional processing to parse that information. Now that we have split the
destinations the tests can be simplified to look for the data they are trying to
validate on the appropriate stream.

(cherry picked from commit 227c0d8150)

Co-authored-by: Cas Donoghue <cas.donoghue@gmail.com>
2025-02-21 12:23:17 -08:00
github-actions[bot]
74aeea691d
entrypoint: avoid polluting stdout (#17125) (#17136)
routes output from setup-related functions to stderr, so that stdout can
include only the output of the actual program.

(cherry picked from commit 91258c3f98)

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
2025-02-21 12:22:47 -08:00
Cas Donoghue
27a1d4354a
Fix acceptance test assertions for updated plugin remove (#17122) (#17132)
This commit updates the acceptance tests to expect messages in the updated
format for removing plugins. See https://github.com/elastic/logstash/pull/17030
for change.
2025-02-21 12:21:57 -08:00
Ry Biesemeyer
5109867459
Fix acceptance test assertions for updated plugin remove (#17126) (#17131)
This commit updates the acceptance tests to expect messages in the updated
format for removing plugins. See https://github.com/elastic/logstash/pull/17030
for change.

Co-authored-by: Cas Donoghue <cas.donoghue@gmail.com>
2025-02-20 09:52:16 -08:00
github-actions[bot]
4e1664ac5c
plugins: improve remove command to support multiple plugins (#17030) (#17121)
Removal works in a single pass by finding plugins that would have unmet
dependencies if all of the specified plugins were to be removed, and
proceeding with the removal only if no conflicts were created.

> ~~~
> ╭─{ rye@perhaps:~/src/elastic/logstash@main (pluginmanager-remove-multiple ✘) }
> ╰─● bin/logstash-plugin remove logstash-input-syslog logstash-filter-grok
> Using system java: /Users/rye/.jenv/shims/java
> Resolving dependencies......
> Successfully removed logstash-input-syslog
> Successfully removed logstash-filter-grok
> [success (00:00:05)]
~~~

(cherry picked from commit 089558801e)

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
2025-02-19 15:42:51 -08:00
github-actions[bot]
c003655973
spec: improve ls2ls spec (#17114) (#17116)
* spec: improve ls2ls spec

 - fixes upstream/downstream convention
   - upstream: the sending logstash (has an LS output)
   - downstream: the receiving logstash (has an LS input)
 - helper `run_logstash_instance` yields the `LogstashService` instance
   and handles the teardown.
 - pass the pipeline id and node name to the LS instances via command line
   flags to make logging easier to differentiate
 - use the generator input's sequence id to ensure that the _actual_ events
   generated are received by the downstream pipeline

* start with port-offset 100

Co-authored-by: Mashhur <99575341+mashhurs@users.noreply.github.com>

---------

Co-authored-by: Mashhur <99575341+mashhurs@users.noreply.github.com>
(cherry picked from commit 9abad6609c)

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
2025-02-18 22:49:12 -08:00
github-actions[bot]
8d45c33269
allow concurrent Batch deserialization (#17050) (#17110)
Currently the deserialization is behind the readBatch's lock, so any large batch will take time deserializing, causing any other Queue writer (e.g. netty executor threads) and any other Queue reader (pipeline worker) to block.

This commit moves the deserialization out of the lock, allowing multiple pipeline workers to deserialize batches concurrently.

- add intermediate batch-holder from `Queue` methods
- make the intermediate batch-holder a private inner class of `Queue` with a descriptive name `SerializedBatchHolder`

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
(cherry picked from commit 637f447b88)

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2025-02-18 10:49:03 +00:00
github-actions[bot]
b9fe1187d4
qa: use clean expansion of LS tarball per fixture instance (#17082) (#17094)
* qa: use clean expansion of LS tarball per fixture instance

Because QA tests can _modify_ the Logstash installation (e.g. those that
invoke the plugin manager), it is important that the service wrapper
begins with a clean expansion of the logstash tarball.

* qa: enable safe reuse of ls_home in ls_to_ls tests

(cherry picked from commit d20eb4dbcb)

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
2025-02-14 09:53:03 -08:00
github-actions[bot]
e0aa026773
Allow capturing heap dumps in DRA BK jobs (#17081) (#17085)
This commit allows Buildkite to capture any heap dumps produced
during DRA builds.

(cherry picked from commit 78c34465dc)

Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
2025-02-14 09:37:13 +02:00
Dimitrios Liappis
c079236666
Fix conflicts (#17073) 2025-02-12 10:46:03 -08:00
github-actions[bot]
92c37da6bb
Don't honor VERSION_QUALIFIER if set but empty (#17032) (#17068)
PR #17006 revealed that the `VERSION_QUALIFIER` env var gets honored in
various scripts when present but empty.
This shouldn't be the case as the DRA process is designed to gracefully
ignore empty values for this variable.

This commit changes various ruby scripts to not treat "" as truthy.
Bash scripts (used by CI etc.) are already ok with this as part of
refactorings done in #16907.

---------

Co-authored-by: Andrea Selva <selva.andre@gmail.com>
(cherry picked from commit c7204fd7d6)

Co-authored-by: Dimitrios Liappis <dimitrios.liappis@gmail.com>
2025-02-12 16:02:02 +02:00
João Duarte
00f8b91c35
inject VERSION_QUALIFIER into artifacts (#16904) (#17049)
VERSION_QUALIFIER was already observed in rake artifacts task but only to influence the name of the artifact.

This commit ensure that the qualifier is also displayed in the cli and in the http api.
2025-02-12 09:08:18 +00:00
Ry Biesemeyer
ad38e0237b
docs: forward-port 8.16.4 and 8.17.2 release notes to 8.x (#17058) 2025-02-11 12:32:10 -08:00
github-actions[bot]
40a7fdf605
Backport PR #16968 to 8.x: Fix BufferedTokenizer to properly resume after a buffer full condition respecting the encoding of the input string (#16968) (#17019)
Backport PR #16968 to 8.x branch, original message:

----

Permit to use effectively the tokenizer also in context where a line is bigger than a limit.
Fixes an issues related to token size limit error, when the offending token was bigger than the input fragment in happened that the tokenzer wasn't unable to recover the token stream from the first delimiter after the offending token but messed things, loosing part of tokens.

## How solve the problem
This is a second take to fix the processing of tokens from the tokenizer after a buffer full error. The first try #16482 was rollbacked to the encoding error #16694.
The first try failed on returning the tokens in the same encoding of the input.
This PR does a couple of things:
- accumulates the tokens, so that after a full condition can resume with the next tokens after the offending one.
- respect the encoding of the input string. Use `concat` method instead of `addAll`, which avoid to convert RubyString to String and back to RubyString. When return the head `StringBuilder` it enforce the encoding with the input charset.

(cherry picked from commit 1c8cf546c2)

Co-authored-by: Andrea Selva <selva.andre@gmail.com>
2025-02-05 12:13:28 +01:00
github-actions[bot]
f561207b4b
upgrade jdk to 21.0.6+7 (#16932) (#16987)
(cherry picked from commit 51ab5d85d2)

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2025-01-30 11:18:35 +00:00
Andrea Selva
6c5ea40576
Update versions.yml next minor (#16980)
Update version with 8.19.0 on 8.x
2025-01-29 17:07:59 +01:00
github-actions[bot]
2a8898a395
plugin manager: add --level=[major|minor|patch] (default: minor) (#16899) (#16973)
* plugin manager: add `--level=[major|minor|patch]` (default: `minor`)

* docs: plugin manager update `--level` behavior

* Update docs/static/plugin-manager.asciidoc

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

* docs: plugin update major as subheading

* docs: intention-first in major plugin updates

* Update docs/static/plugin-manager.asciidoc

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

---------

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
(cherry picked from commit 6943df5570)

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
2025-01-28 17:17:16 -08:00
kaisecheng
a9bc298983
add openssl command to wolfi image (#16970) 2025-01-28 17:31:39 +00:00
github-actions[bot]
a74ef7982a
remove irrelevant warning for internal pipeline (#16938) (#16962)
This commit removed irrelevant warning for internal pipeline, such as monitoring pipeline.
Monitoring pipeline is expected to be one worker. The warning is not useful

Fixes: #13298
(cherry picked from commit 3f41828ebb)

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
2025-01-27 17:29:40 +00:00
Andrea Selva
a0378c05cb
[Backport 8.x] Reimplement LogStash::String setting in Java (#16576) (#16959)
Non clean backport of #16576 

----

Reimplements `LogStash::Setting::String` Ruby setting class into the `org.logstash.settings.SettingString` and exposes it through `java_import` as `LogStash::Setting::SettingString`.
Updates the rspec tests in two ways:
- logging mock is now converted to real Log4J appender that spy log line that are later verified
- verifies `java.lang.IllegalArgumentException` instead of `ArgumentError` is thrown because the kind of exception thrown by Java code, during verification.

* Fixed the rename of NullableString to SettingNullableString

* Fixed runner test to use real spy logger from Java Settings instead of mock test double
2025-01-27 16:08:51 +01:00
github-actions[bot]
a390dcc9d0
fix user and password detection from environment's uri (#16955) (#16956)
(cherry picked from commit c8a6566877)

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2025-01-27 11:51:02 +00:00
github-actions[bot]
388db0f831
Doc: Remove extra symbol to fix formatting error (#16926) (#16934)
(cherry picked from commit f66e00ac10)

Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
2025-01-23 17:34:38 -05:00
github-actions[bot]
0cc5febf94
[doc] fix the necessary privileges of central pipeline management (#16902) (#16928)
CPM requires two roles logstash_admin and logstash_system

Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
(cherry picked from commit dc740b46ca)

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
2025-01-23 11:36:17 +00:00
João Duarte
5063d8a939
fix jars installer for new maven and pin psych to 5.2.2 (#16920)
8.x backport of https://github.com/elastic/logstash/pull/16919

handle maven output that can carry "garbage" information after the jar's name. this patch deletes that extra information, also pins psych to 5.2.2 until jruby ships with snakeyaml-engine 2.9 and jar-dependencies 0.5.2

Related to: jruby/jruby#8579
2025-01-22 15:53:08 +00:00
kaisecheng
5b9e23c9fb
Forward 8.17.1 release notes (#16923)
* Release notes for 8.17.1 (#16880)
* Release notes for 8.16.3 (#16879) (#16918)
2025-01-22 14:05:44 +00:00
Dimitrios Liappis
bc90250582
Backport 16907 to 8.x: Use --qualifier in release manager (#16907) (#16913)
This commit uses the new --qualifier parameter in the release manager
for publishing dra artifacts. Additionally, simplifies the expected
variables to rely on a simple `VERSION_QUALIFIER`.

Snapshot builds are skipped when VERSION_QUALIFIER is set.
Finally, for helping to test DRA PRs, we also allow passing the `DRA_BRANCH`  option/env var
to override BUILDKITE_BRANCH.

Closes https://github.com/elastic/ingest-dev/issues/4856

Backported from #16907 cherry picked from 9385cfac5a
2025-01-20 19:41:04 +02:00
github-actions[bot]
094724cd72
Increase Xmx used by JRuby during Rake execution to 4Gb (#16911) (#16914)
(cherry picked from commit 58e6dac94b)

Co-authored-by: Andrea Selva <selva.andre@gmail.com>
2025-01-20 17:51:07 +01:00
github-actions[bot]
24104833a4
Add %{{TIME_NOW}} pattern for sprintf (#16906) (#16908)
* Add a new pattern %{{TIME_NOW}} to `event.sprintf` to generate a fresh timestamp.
The timestamp is represented as a string in the default ISO 8601 format

For example,
```
input {
    heartbeat {
    add_field => { "heartbeat_time" => "%{{TIME_NOW}}" }
    }
}
```

(cherry picked from commit cd729b7682)

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
2025-01-17 22:28:12 +00:00
Cas Donoghue
b8d2cec619
Replace/remove references to defunct freenode instance (#16873) (#16897)
The preferred channel for communication about LS is the elastic discussion
forum, this commit updates the source code and readme files to reflect that.
2025-01-13 09:50:11 -08:00
Ry Biesemeyer
bc9aee215e
deprecate pipeline bus v1 (#16643)
* retrofit pipeline bus selection tests

* pipeline bus: when invalid override specified, use v2

* deprecate pipeline bus v1
2025-01-10 15:55:16 -08:00
github-actions[bot]
5763eb0cd4
Validate the size limit in BufferedTokenizer. (#16882) (#16890)
(cherry picked from commit a215101032)

Co-authored-by: Mashhur <99575341+mashhurs@users.noreply.github.com>
2025-01-09 16:52:18 -08:00
github-actions[bot]
6986f99ee7
Test touchups (#16884) (#16885)
* test: improved and clearer stream read constraints validation

* test: remove unused  var

(cherry picked from commit 4554749da2)

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
2025-01-09 13:49:25 -08:00
github-actions[bot]
cba559220d
Initialize flow metrics if pipeline metric.collect params is enabled. (#16881) (#16886)
(cherry picked from commit 47d04d06b2)

Co-authored-by: Mashhur <99575341+mashhurs@users.noreply.github.com>
2025-01-09 13:32:06 -08:00
github-actions[bot]
6b45a21c56
jackson stream read constraints: code-based defaults (#16854) (#16883)
* Revert "Apply Jackson stream read constraints defaults at runtime (#16832)"

This reverts commit cc608eb88b.

* jackson stream read constraints: code-based defaults

refactors stream read constraints to couple default values with their
associated overrides, which allows us to have more descriptive logging
that includes provenance of the value that has been applied.

(cherry picked from commit 16392908e2)

Co-authored-by: Ry Biesemeyer <yaauie@users.noreply.github.com>
2025-01-09 11:47:33 -08:00
João Duarte
871d62fa59
Forward port 8.15.5 and 8.16.2 release notes to 8.x (#16809)
Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
2025-01-08 11:46:16 +00:00
Mashhur
00c2b303de
elastic_integration plugin version updated. (#16876) 2025-01-07 18:26:28 -08:00
Cas Donoghue
0ac587edc9
Ensure plugin config marked :deprecated logs to deprecation logger (#16863)
* Ensure plugin config marked :deprecated logs to deprecation logger (#16833)

Previously when the `:deprecated` modifier was used in the plugin config DSL a
log message was sent at `:warn` level to the main logger. This commit updates
that message to be routed *only* to the deprecation logger.

* Ensure plugin config marked `:deprecated` logs to deprecation logger

Previously when the `:deprecated` modifier was used in the plugin config DSL a
log message was sent at `:warn` level ONLY to the main logger. This commit updates
that message to be routed *both* to the deprecation logger as well as the main
logger. In 9.x this will *only* go to the deprecation logger.
2025-01-07 07:24:26 -08:00
github-actions[bot]
267eacc344
Respect environment variables in jvm.options (#16834) (#16866)
JvmOptionsParser adds support for ${VAR:default} syntax when parsing jvm.options
- allow dynamic resolution of environment variables in the jvm.options file
- enables fallback to default value when the environment variable is not set

(cherry picked from commit ef36df6b81)

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
2025-01-07 15:04:10 +00:00
Karen Metts
4bf1fb514e
Doc: Add appropriate alternate for deprecated module in 8.x (#16856) 2025-01-06 15:34:26 -05:00
github-actions[bot]
7341ff6e2f
Add pipeline metrics to Node Stats API (#16839) (#16850)
This commit introduces three new metrics per pipeline in the Node Stats API:
- workers
- batch_size
- batch_delay

```
{
  ...
  pipelines: {
    main: {
      events: {...},
      flow: {...},
      plugins: {...},
      reloads: {...},
      queue: {...},
      pipeline: {
        workers: 12,
        batch_size: 125,
        batch_delay: 5,
      },
    }
  }
  ...
}
```

(cherry picked from commit de6a6c5b0f)

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
2025-01-03 20:53:51 +00:00
github-actions[bot]
a3ab584257
Apply Jackson stream read constraints defaults at runtime (#16832) (#16845)
When Logstash 8.12.0 added increased Jackson stream read constraints to
jvm.options, assumptions about the existence of that file's contents
were invalidated. This led to issues like #16683.

This change ensures Logstash applies defaults from config at runtime:
- MAX_STRING_LENGTH: 200_000_000
- MAX_NUMBER_LENGTH: 10_000
- MAX_NESTING_DEPTH: 1_000

These match the jvm.options defaults and are applied even when config
is missing. Config values still override these defaults when present.

(cherry picked from commit cc608eb88b)

Co-authored-by: Cas Donoghue <cas.donoghue@gmail.com>
2025-01-02 15:24:18 -08:00
github-actions[bot]
1931c32e3a
Doc: Add json_lines known issue to release notes (#16831) (#16836)
(cherry picked from commit c77396c2db)

Co-authored-by: Karen Metts <35154725+karenzone@users.noreply.github.com>
2024-12-26 15:46:48 -05:00