-
Notifications
You must be signed in to change notification settings - Fork 474
[system + winlog] Fix mapping for time_created to date #5350
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
Conversation
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
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'm not sure we can do this safely; in system, if the date
processor fails we have a field that may fail ingest and in winlog there is no pipeline, so we have no control of the format of the value in the field and so again risk an ingest failure. The system case could be made more safe, but winlog has no processor by design.
Also, what are the implications for existing installations with a mapping change?
Today, it seems that this field doesn't exist anyways. In the System System, and Application mappings, this field does not exist so they are not in conflict with the properly mapped Winlogbeat mappings. Do you have any modern examples with the Elastic Agent and of the System or Custom Windows logs that this field exists? None the less, the other option is to remove this field mapping entirely. Right now it is inconsistent between the System Integrations, Windows and Custom Windows integrations. What would you recommend? |
Thanks, the mapping in winlogbeat supports this change. I think I'd suggest leaving the winlog integration as you have it; the responsibility I guess lies on the user to provide an appropriate pipeline to handle the data stream. For the system/security it could be made safe by adding an Something like
Could also consider a rename instead of a remove in the case of a failure. |
I like the fail safe in the pipeline. I am good with adding that. I am wondering if the sample document came from Splunk or a third party ingestion tool because of the 10k winlogbeat endpoints and many event channels, time_created doesn't appear to exist. We only have about 30 Elastic agents with the reapective integrations but no matches yet. I see the sample doc was from 2019 so there could have been a change in the last 3-4 years for this source. |
I went ahead and adapted your feedback for adjusting the pipeline. |
/test |
@@ -61,8 +61,17 @@ processors: | |||
field: winlog.time_created |
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.
We do need the tag here.
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.
Okay, I will add it in.
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.
Added
🌐 Coverage report
|
Corrected, please test. |
/test |
field: error.message | ||
value: "fail-{{{ _ingest.on_failure_processor_tag }}}" | ||
- fail: | ||
message: "Processor {{ _ingest.on_failure_processor_type }} with tag {{ _ingest.on_failure_processor_tag }} in pipeline {{ _ingest.on_failure_pipeline }} failed with message: {{ _ingest.on_failure_message }}" | ||
on_failure: | ||
- set: |
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 just noticed this. Please make this an append
, otherwise the fail tag will be lost. Also set the event.kind
as shown above.
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'd prefer that these were set in the global on_failure
. This way if we add others in the future, they are already handled.
How is that? |
field: error.message | ||
value: "fail-{{{ _ingest.on_failure_processor_tag }}}" | ||
- fail: | ||
message: "Processor {{ _ingest.on_failure_processor_type }} with tag {{ _ingest.on_failure_processor_tag }} in pipeline {{ _ingest.on_failure_pipeline }} failed with message: {{ _ingest.on_failure_message }}" | ||
on_failure: | ||
- set: |
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'd prefer that these were set in the global on_failure
. This way if we add others in the future, they are already handled.
- set: | ||
field: event.kind | ||
value: pipeline_error | ||
- append: |
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.
Please revert eab6083.
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 couldn't find a way to revert here on github.com so I applied changes to align to what it was before this commit.
on_failure: | ||
- set: | ||
field: error.message |
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.
The global on_failure
should be
on_failure:
- set:
field: event.kind
value: pipeline_error
- append:
field: error.message
value: "{{ _ingest.on_failure_message }}"
This way local formatting of the failure message is preserved in conjunction with any failure tags.
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.
Do I remove this then?
- set:
field: error.message
value: |-
Processor "{{ _ingest.on_failure_processor_type }}" with tag "{{ _ingest.on_failure_processor_tag }}" in pipeline "{{ _ingest.on_failure_pipeline }}" failed with message "{{ _ingest.on_failure_message }}"
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.
Yep. If you take the suggestion I started with and replace all of the text in the file from the date processor on with that, then you have what we need.
I think I am getting closer. Sorry this one has been a rough go :D |
Sorry pushing the wrong buttons on my phone. Ready to test? |
Can you amend the global |
Sorry I forgot to put those back in as intended. Please give that a go. |
value: |- | ||
Processor "{{ _ingest.on_failure_processor_type }}" with tag "{{ _ingest.on_failure_processor_tag }}" in pipeline "{{ _ingest.on_failure_pipeline }}" failed with message "{{ _ingest.on_failure_message }}" |
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.
value: |- | |
Processor "{{ _ingest.on_failure_processor_type }}" with tag "{{ _ingest.on_failure_processor_tag }}" in pipeline "{{ _ingest.on_failure_pipeline }}" failed with message "{{ _ingest.on_failure_message }}" | |
value: "{{ _ingest.on_failure_message }}" |
The errors are already formatted in the fail
processor.
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.
Understood. Updated.
/test |
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.
Thanks
You are welcome! Thanks for the help! |
Package system - 1.24.3 containing this change is available at https://epr.elastic.co/search?package=system |
Package winlog - 1.12.2 containing this change is available at https://epr.elastic.co/search?package=winlog |
What does this PR do?
This sets the winlog.time_created field (currently keyword) to a date type. Even though that I have no data that has this field any longer (in Winlogbeat or Elastic Agent System or Custom Windows event log integrations), I see that it exists in the sample json files provided in the pipelines directory for testing, so instead of removing it, I am updating to a date as it should be.
Checklist
changelog.yml
file.