Convert timestamp field from yyyy-MM-dd HH:mm:ss to yyyy-MM-dd HH:mm:ss.SSS

Hello I have a logstash input from amazon kinesis than one field "news_timestamp" have an timestamp with this format "yyyy-MM-dd HH:mm:ss"

I need to update this field adding the milliseconds .000 like this "yyyy-MM-dd HH:mm:ss.SSS"

how I can do this, im using elasticsearch 6.x and logstash 6.x,

thanks for advance

You can use a mutate filter to either

  • use gsub to substitute the end of the string ($) with ".000" or
  • use the replace option to set the field's value to "%{news_timestamp}.000".

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.