Meta fields are not handled consistently in different processors #25425
Labels
good first issue
Indicates a good issue for first-time contributors
Team:Elastic-Agent
Label for the Agent team
Team:Elastic-Agent-Data-Plane
Label for the Agent Data Plane team
v8.1.0
TLDR; All processors should use
event.PutValue
when setting fields to have a consistent behaviour.Some fields set in events are intended to provide information to the pipelines, for example
@timestamp
to set the timestamp of the event or@metadata._id
to set its id. This is not being handled in a consistent way between processors.For example when the id is set using the fingerprint processor, it works as expected:
It doesn't set
@metadata._id
in the fields of the event, but it uses it as the id of the generated document.On the other hand, if
add_fields
is used to set one of these special fields, the field is set in the event and not handled by the pipeline:In this case the
index
bulk operation should be used, but it isn't, and@metadata.op_type
is set as a field in the event.The cause of this difference is that some processors use the
event.PutValue
method, that handles these cases, and other processors use lower level mechanisms asevent.Fields.Put
, or directlyevents.Fields[key] = value
.All processors should use
event.PutValue
when setting fields to have a consistent behaviour.For confirmed bugs, please report:
create
bulk requests are used and then the documents are not updated:As a workaround, expected result can be achieved setting
@metadata.op_type
with theconvert
processor, that usesPutValue
:Related:
@metadata
fields Document @metadata fields #23091The text was updated successfully, but these errors were encountered: