Skip to content

Conversation

@jrmolin
Copy link
Contributor

@jrmolin jrmolin commented Mar 13, 2025

A user is noticing parsing failures with the cef processor that can be attributed to empty fields not being properly ignored.

Proposed commit message

[cef] Update the settings to ignore empty fields

  • When the pipeline hits empty fields, it errors out
  • An update in the cef_processor allows for empty fields to be ignored, but this is not configurable in the settings
  • This updates the settings to add a configuration value to turn on/off the ability to ignore empty fields
  • A new test was added
  • No test regressions

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.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@andrewkroh andrewkroh added the Integration:cef Common Event Format (CEF) label Mar 13, 2025
@jrmolin jrmolin changed the title stash [cef] Update Beats config to ignore empty fields Mar 14, 2025
@jrmolin jrmolin added the bugfix Pull request that fixes a bug issue label Mar 14, 2025
@jrmolin
Copy link
Contributor Author

jrmolin commented Mar 14, 2025

@P1llus could you check this for me, please?

Copy link
Member

@P1llus P1llus left a comment

Choose a reason for hiding this comment

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

Except the note the rest seems correct :)

@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@jrmolin jrmolin marked this pull request as ready for review March 18, 2025 13:41
@jrmolin jrmolin requested a review from a team as a code owner March 18, 2025 13:41
@andrewkroh andrewkroh added the Team:Security-Deployment and Devices DEPRECATED Deployment and Devices Security team [elastic/sec-deployment-and-devices] label Mar 18, 2025
@elasticmachine
Copy link

Pinging @elastic/sec-deployment-and-devices (Team:Security-Deployment and Devices)

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

The test changes look good now.

I assume the intention behind using YAML anchors is to reduce duplication, but I have concerns about whether the added complexity and loss of readability make it worthwhile. It's not a blocker from me, but I would seek out a few more opinions.

@jrmolin
Copy link
Contributor Author

jrmolin commented Mar 20, 2025

The test changes look good now.

I assume the intention behind using YAML anchors is to reduce duplication, but I have concerns about whether the added complexity and loss of readability make it worthwhile. It's not a blocker from me, but I would seek out a few more opinions.

i can revert those. now that i know they work, i'm excited about the possibility of using them in pipelines

@taylor-swanson
Copy link
Contributor

The test changes look good now.
I assume the intention behind using YAML anchors is to reduce duplication, but I have concerns about whether the added complexity and loss of readability make it worthwhile. It's not a blocker from me, but I would seek out a few more opinions.

i can revert those. now that i know they work, i'm excited about the possibility of using them in pipelines

I have mixed feelings about them. On one hand, it's really nice to avoid code duplication, but it does reduce readability, at least at first. I think with time I could get used to it.

@elasticmachine
Copy link

💚 Build Succeeded

History

@@ -0,0 +1,3 @@
<163>Apr 1 05:14:15 192.0.2.1 CEF:0|Elastic|Vaporware|1.0.0-alpha|18|Web request|low|cs1= msg=rfc3164
Apr 1 05:14:15 192.0.2.1 CEF:0|Elastic|Vaporware|1.0.0-alpha|18|Web request|low|msg=rfc3164 cs2=
2021-04-01T05:14:15.000003Z 192.0.2.1 rfc5424App 8710 - - CEF:0|Elastic|Vaporware|1.0.0-alpha|18|Web request|low|cs4= msg=rfc5424 cs3= cs1= cs2= eventId=22
Copy link
Contributor

Choose a reason for hiding this comment

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

Interested to see how the ingest document looks like if ignore_empty_values is false. Is it something like this? Or does it fail?

cef: { cs1: null, cs2: null, message: rfc5424, ......... 
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking at the associated SDH, it looks like it was producing empty strings, which was throwing off another processor. Unfortunately, since this involves a beats processor, we don't have a sample event we can look at like we can with a pipeline test.

@jrmolin, could you fill out the PR description explaining why this change is needed? Doesn't need to be extensive, just something brief. Helps reviewers know why this change is going in.

Copy link
Contributor

Choose a reason for hiding this comment

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

@taylor-swanson Running elastic-package system test , can we not see what event.original / message field looks like in the pipeline? It should be the one processed from beats processors? Or do we bypass the agent config?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yes, you could do that, it's just a manual process rather than looking at the expected file in github.

Copy link
Contributor

Choose a reason for hiding this comment

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

But yeah, I was just curious. But this is not a blocker comment @jrmolin .. But as Taylor mentioned please add some description about the change.

@jrmolin jrmolin merged commit ee8623f into elastic:main Mar 21, 2025
7 checks passed
@elastic-vault-github-plugin-prod

Package cef - 2.21.1 containing this change is available at https://epr.elastic.co/package/cef/2.21.1/

@jrmolin jrmolin deleted the cef-ignore_empty_fields branch March 24, 2025 17:39
flexitrev pushed a commit that referenced this pull request Mar 25, 2025
* When the pipeline hits empty fields, it errors out * An update in the cef_processor allows for empty fields to be ignored, but this is not configurable in the settings * This updates the settings to add a configuration value to turn on/off the ability to ignore empty fields * A new test was added * No test regressions
flexitrev pushed a commit that referenced this pull request Mar 28, 2025
* When the pipeline hits empty fields, it errors out * An update in the cef_processor allows for empty fields to be ignored, but this is not configurable in the settings * This updates the settings to add a configuration value to turn on/off the ability to ignore empty fields * A new test was added * No test regressions
flexitrev pushed a commit that referenced this pull request Mar 28, 2025
* When the pipeline hits empty fields, it errors out * An update in the cef_processor allows for empty fields to be ignored, but this is not configurable in the settings * This updates the settings to add a configuration value to turn on/off the ability to ignore empty fields * A new test was added * No test regressions
flexitrev pushed a commit that referenced this pull request Mar 28, 2025
* When the pipeline hits empty fields, it errors out * An update in the cef_processor allows for empty fields to be ignored, but this is not configurable in the settings * This updates the settings to add a configuration value to turn on/off the ability to ignore empty fields * A new test was added * No test regressions
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:cef Common Event Format (CEF) Team:Security-Deployment and Devices DEPRECATED Deployment and Devices Security team [elastic/sec-deployment-and-devices]

6 participants