-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Osquerybeat: Fix data_stream configuration, enforce the default values used before 8.6.0 #34246
Conversation
…s used before 8.6.0
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
ds := *rawIn.GetDataStream() | ||
ds.Dataset = config.DefaultDataset | ||
ds.Type = config.DefaultType | ||
datastream = &ds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, but if the dataset or type ever becomes configurable it will break. That's probably unlikely though.
rawIn.Streams = streams | ||
|
||
procs := defaultProcessors() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't comment directly on this, but this block below can be removed:
beats/x-pack/osquerybeat/cmd/root.go
Lines 89 to 91 in b5246c4
for iter := range modules { | |
modules[iter]["type"] = "log" | |
} |
That is trying to set an input type, which I don't think matters for osquerybeat. It is just adding an arbitrary type: log
into the generated config that osquerybeat will be ignoring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, don't remember the reason for this. can clean up later, separately from this more urgent fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a copy/paste error from one of the other Beats, agree this can be removed separately.
You should probably have a changelog entry for this one. |
The packaging failure is unrelated, caused by elastic/golang-crossbuild#232 |
…s used before 8.6.0 (#34246) (#34262) * Osquerybeat: Fix data_stream configuration, enforce the default values used before 8.6.0 * Added changelog entry (cherry picked from commit f9ed028) Co-authored-by: Aleksandr Maus <[email protected]>
…s used before 8.6.0 (#34246) * Osquerybeat: Fix data_stream configuration, enforce the default values used before 8.6.0 * Added changelog entry
What does this PR do?
Fixes the values for the
data_stream
:type
anddataset
.The 8.6.0 has wrong values set after switching to using the V2 libbeat
management.CreateInputsFromStreams
implementation that is inserting the policy processor:resulting in these
data_stream
properties.This PR sets the expected default values on the datastream before the configuration transformation takes place thus setting the values back to what it was before 8.6.0:
These fields are mapped as the constant_keywords and should never be changed.
Why is it important?
Fixes the breakage with the Osquery Logstash integration because the logstash sends the data based on the
data_stream
"hint", resulting in the output going toosquery-generic-default
instead oflogs-osquery_manager.result-default
Also the defect makes 8.6.0 osquery results incompatible with previous releases results documents data. And since the fields are constant, in the mixed agent versions environment or upon upgrade this can cause the issues indexing the osquery results documents.
Resulting in the errors such as:
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues
Screenshots
Verified the document
data_stream
is set correctly when sending data to elasticsearch outputVerified the document
data_stream
is set correctly when sending data to logstash output