-
'lo all, my vector config somehow doesn't transfer the "@timestamp" field from the source into the actual "@timestamp" field in opensearch document. Vector seems to insert/replace(?) the original Kafka message @timestamp with a timestamp that reflects the time of consumption. I'm using following config to stream incoming Kafka messages towards an Opensearch 2.2.x., I originally didn't have a transform-section, but with and without result stays the same. VECTOR configuration:
INPUT message example:
OUTPUT opensearch through Vector:
Notice the @timestamp is not the one from the Kafka source message. Am I missing something in my configuration ? grtz, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @Djeezus ! The issue here is that Vector has an internal log schema that determines where to find the timestamp of the log in sinks. By default this field is called transforms:
parse_timestamp:
type: remap
inputs: [kafka]
source: |-
.timestamp = to_timestamp!(del(.@timestamp)) This should put the timestamp where the |
Beta Was this translation helpful? Give feedback.
Hi @Djeezus !
The issue here is that Vector has an internal log schema that determines where to find the timestamp of the log in sinks. By default this field is called
timestamp
so, in the Elasticsearch sink, it looks for atimestamp
field, to send it as@timestamp
. This can be changed using the global log_schema.timestamp_key option (note this applies to the entire configuration). Alternatively, you could change yourremap
transform to be:This should put the timestamp where the
elasticsearch
sink expects to find it.