Hi all
I have a custom field
msg.message.timestamp which have the date in the format yyyy-MM-ddThh:mm:ss.nnnZ format
eg. 2019-12-11T10:17:54.961Z
I would like to use this as @timestamp. I tied a couple of things without success:
Try 1:
if ([msg][message][timestamp]){
ruby {
id => update_timetaken_with_msg_message_timestamp
code => "b=event.get('[msg][message][timestamp]'); event.set('@timestamp', DateTime.parse(b);"
}
}
Try 2:
mutate {
convert => { "[msg][message][timestamp]" => "string" }
}
date {
match => ["[msg][message][timestamp]", "yyyy-MM-dd'T'HH:mm:ss'.'SSS'Z'"]
timezone => "UCT"
target => "@timestamp"
}
But unfortunately, both are not working
Regards, Ginu