event.original field should be preserved by ingest pipelines when mapping errors happen #33347
Labels
Filebeat
Filebeat
Team:Security-Deployment and Devices
Deployment and Devices Team in Security Solution
SUMMARY
When using the Filebeat Cisco ASA module (possibly other modules) there is inconsistent usage about how the newer
event.original
field gets used during mapping errors, compared to the legacylog.original
field it is meant to replace. Theevent.original
filed should be preserved with the original message so that users can troubleshoot the event causing the issue.The goal of this filing is to get the product ingest pipelines that have this issue to be changed to better-handle the described fields by default, so that end-users don't have to make the manual changes described below.
DETAILS
For background, there is an RFC proposal to remove
log.original
in favor of usingevent.original
(here: https://github.com/elastic/ecs/blob/main/rfcs/text/0017-remove-log-original.md). However, when a message that fails to be parsed due to a mapping issue,event.original
is not part of the error message at all (log.original
is). This is an issue because the original message gets stored in theevent.original
field but the failing event doesn't contain anevent.original
field at all. This makes it impossible for a user who really only cares about what is in the original message to display the real message they are searching for.EXAMPLE
This is what you see when an event is successfully parsed/processed:
This is what you see when the event fails to properly map:
CAUSE & WORKAROUNDS
This is caused in the Ingest processor for the module by the
rename
processor that moves thelog.original
field toevent.original
being located farther down the pipeline. When thegrok
processor fails, therename
processor gets skipped andevent.original
will not be set. A quick, manual, fix would be to add the rename processor to the Failure Processors at the bottom of the pipeline. This way, as long aslog.original
has been set, it will always be propagated toevent.original
, even in the event of failure. The pipeline can be edited from Kibana viaStack Management > Ingest Pipelines
. See screenshots below for examples.Another way to look at handling this would be to add a
set
processor to the on-failure processors. which copies the value ofmessage
toevent.original
. That way, if the grok processor that setslog.original
fails, there will still be a value inevent.original
. In that case, the therename
processor mentioned above must be changed to aset
processor that copies the value fromlog.original
. This is because therename
processor will fail if the target field already exists. In this scenario it may be worth also to add aremove
processor to remove thelog.original
field, since it will still be left around. The order of processors would then be:set
processor, copiesmessage
toevent.original
set
processor, copieslog.original
toevent.original
remove
processor, removeslog.original
The text was updated successfully, but these errors were encountered: