Search code examples
csvelasticsearchlogstash

Logstash change timestamp to dd-mm-yy only


I try to import csv to elasticsearch using Logstash

Field data contains data in dd/mm/yy format - 08/02/23 for example

I need to change timestamp to date-month-year only

Try to use this:

date {
          match => ["date", "dd/MM/yy"]
          target => ["@timestamp"]
}

But logstash( or elastic) add hour:minute:seconds to my date

Is it possible to change timestamp field only to date-month-year,without time?


Solution

  • Logstash adds a @timestamp field automatically when the event enters event pipeline. But you're completely free to ignore that field altogether and use any other date field in your queries. Just make sure that your date is really mapped as a date type in your index mapping and you're good to go