I have the following configuration:
Filebeat -> Kafka -> Logstash -> ES
In logstash.conf I assign value of variable logTimestamp
to @timestamp
:
grok {
match => {"message" => "(?<logTime>[0-9]{2}:[0-9]{2}:[0-9]{2},[0-9]{3})"}
}
ruby {
code => 'event.set("currentDate", Time.now.getlocal("-05:00").strftime("%Y.%m.%d"))'
}
ruby {
code => 'event.set("logTimestamp", event.get("currentDate") + " " + event.get("logTime"))'
}
date {
match => ["logTimestamp", "YYYY.MM.dd HH:mm:ss,SS"]
}
So the field values of logTimestamp
and @timestamp
should be the same. But in Kibana I can see they are different:
:
This is what Logstash logs show:
"logTimestamp" => "2017.07.12 00:59:24,578",
"@timestamp" => 2017-07-12T22:06:22.463Z,
It's also unclear what timestamp value is assigned to @timestamp
.
Could anybody explain why that happened?