Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Logstash] Add guard against missing elements in codec payload #10938

Merged
merged 1 commit into from
Oct 3, 2024

Conversation

robbavey
Copy link
Member

Proposed commit message

Add guard against missing elements in codec payload

Due to a bug in Logstash (elastic/logstash#16410), when configuring a codec with optional settings, the stats do not get generated, causing the data collection for codecs, and thus plugins to fail.

This commit adds a guard to the retrieval of encode and decode to ensure that the CEL input does not fail when encountering this issue.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

How to test this PR locally

Setup Logstash Integration to point to a working Logstash instance, the Logstash pipeline should include a codec that is configured with an optional parameter, eg

input { 
  stdin {
    codec => json { id => "json" }
  }
}

Navigate to the Pipeline Details Overview page, and verify that there is data for this pipeline. There should be entries in the input and codec sections of the page.

Related issues

elastic/logstash#16410

@robbavey robbavey added the bugfix Pull request that fixes a bug issue label Aug 29, 2024
@robbavey robbavey requested a review from a team as a code owner August 29, 2024 18:22
Due to a bug in Logstash (elastic/logstash#16410),
when configuring a codec with optional settings, the stats do not get generated,
causing the data collection for codecs, and thus plugins to fail.

This commit adds a guard to the retrieval of `encode` and `decode` to ensure
that the CEL input does not fail when encountering this issue
@andrewkroh andrewkroh added Integration:logstash Logstash Team:Stack Monitoring Stack Monitoring team [elastic/stack-monitoring] labels Aug 29, 2024
@elasticmachine
Copy link

🚀 Benchmarks report

Package logstash 👍(0) 💚(1) 💔(1)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
log 6134.97 5128.21 -1006.76 (-16.41%) 💔

To see the full report comment with /test benchmark fullreport

@elasticmachine
Copy link

💚 Build Succeeded

@botelastic
Copy link

botelastic bot commented Sep 28, 2024

Hi! We just realized that we haven't looked into this PR in a while. We're sorry! We're labeling this issue as Stale to make it hit our filters and make sure we get back to it as soon as possible. In the meantime, it'd be extremely helpful if you could take a look at it as well and confirm its relevance. A simple comment with a nice emoji will be enough :+1. Thank you for your contribution!

@botelastic botelastic bot added the Stalled label Sep 28, 2024
Copy link
Contributor

@consulthys consulthys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@botelastic botelastic bot removed the Stalled label Sep 29, 2024
@robbavey robbavey merged commit 3d615b8 into elastic:main Oct 3, 2024
5 checks passed
@elastic-vault-github-plugin-prod

Package logstash - 2.4.11 containing this change is available at https://epr.elastic.co/search?package=logstash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull request that fixes a bug issue Integration:logstash Logstash Team:Stack Monitoring Stack Monitoring team [elastic/stack-monitoring]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants