ecs-logging-java icon indicating copy to clipboard operation
ecs-logging-java copied to clipboard

Customize the key names like @timestamp

Open NFehringVHV opened this issue 1 year ago • 0 comments

Hi,

I want to customize the key names like @timestamp. Because there is a problem with Logstash Parser and @timestamp => https://github.com/logstash-plugins/logstash-filter-date/issues/95

My workaround in the logstash parser: mutate { copy => { "@timestamp" => "timestamp_modified" } } mutate { convert => { "timestamp_modified" => "string" } } date { match => [ "timestamp_modified", "ISO8601" ] tag_on_failure => "_dateparsefailure" add_tag => [ "date_replaced" ] }

The keys are hard coded in https://github.com/elastic/ecs-logging-java/blob/7dbf50e9021725cc53cd75fc7b4de170aeca2c11/ecs-logging-core/src/main/java/co/elastic/logging/EcsJsonSerializer.java#L34

Best Niklas

NFehringVHV avatar Aug 18 '23 08:08 NFehringVHV