my input json file (coming from mongoexport) is showing the time in scientific notation, for example:
"lastUpdate":1.575882773525e+12
When I try and convert this to date format using "UNIX_MX" I get the following
lastUpdate 1,575,882,773,525
and the system @timestamp is incorrect:
@timestamp Dec 9, 2019 @ 11:12:53.525 (the correct timestamp is Dec 14 2019 and works fine when I don't us the date filter)
Please suggest how I can fix this issue.
This is my input and filter code:
input { file { path => "/usr/share/logstash/mydata/mongodb.json" start_position => "beginning" sincedb_path => "/dev/null" codec => json } } ## Add your filters / logstash plugins configuration here filter { date { match => [ "lastUpdate" => "UNIX_MS" ] } mutate { remove_field => [ "_id", "path", "host", "userId", "lessonId", "tags", "classreportId", "data.lesson.image", "answers.checkAnswer"] } }