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

Cherry-pick #18991 to 7.7: Fix translate_sid's empty target field handling #19085

Merged
merged 2 commits into from
Jun 10, 2020

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Jun 9, 2020

Cherry-pick of PR #18991 to 7.7 branch. Original message:

What does this PR do?

The translate_sid processor only requires one of the three target fields to be configured. It should work properly when some of the targets are not set, but it doesn't check if they are empty strings. So it ends up adding target fields that are empty strings to the event (e.g. "": "Group").

Why is it important?

Without this fix, if some target fields were not set then the beat would produce invalid events that cannot be indexed.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

The translate_sid processor only requires one of the three target fields to be configured. It should work properly when some of the targets are not set, but it doesn't check if the are empty strings. So it ends up adding target fields that are empty strings to the event (e.g. "": "Group").

Closes elastic#18990

(cherry picked from commit baccaad)
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 9, 2020
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 10, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

@marc-gr
Copy link
Contributor

marc-gr commented Jun 10, 2020

jenkins run tests

@andrewkroh
Copy link
Member Author

The 7.7 build is failing in Metricbeat unrelated to this change. I will investigate.

[2020-06-10T12:05:24.382Z] mage createMetricset
[2020-06-10T12:05:34.381Z] # command-line-arguments
[2020-06-10T12:05:34.381Z] ./magefile.go:78:3: unknown field 'ShortParts' in struct literal of type "github.com/elastic/beats/v7/dev-tools/mage".ConfigFileParams
[2020-06-10T12:05:34.381Z] ./magefile.go:79:3: unknown field 'ReferenceParts' in struct literal of type "github.com/elastic/beats/v7/dev-tools/mage".ConfigFileParams
[2020-06-10T12:05:34.381Z] ./magefile.go:80:3: unknown field 'DockerParts' in struct literal of type "github.com/elastic/beats/v7/dev-tools/mage".ConfigFileParams
[2020-06-10T12:05:34.381Z] Error: error compiling magefiles

@andrewkroh andrewkroh merged commit a69894f into elastic:7.7 Jun 10, 2020
@andrewkroh andrewkroh deleted the backport_18991_7.7 branch January 14, 2022 14:08
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…eld handling (elastic#19085)

The translate_sid processor only requires one of the three target fields to be configured. It should work properly when some of the targets are not set, but it doesn't check if the are empty strings. So it ends up adding target fields that are empty strings to the event (e.g. "": "Group").

Closes elastic#18990

(cherry picked from commit 4b19f09)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants