Hello everyone!
I'm trying to index a .csv file with Logstash.
One of the field of the file is a string that rappresent a date ("yyyy-MM-dd HH:mm"), and i want to convert this field into a date type at the momento of uploading.
The filter i'm using is:
filter{
date{
match => ["logdate", "yyyy-MM-dd HH:mm"]
}
mutate {convert => ["start", "date"]}
}
but it's not working, it upload the "start" field as a string.
Does anyone have any ideas?
Unless configured otherwise with the target option the date filter writes the parsed timestamp to the @timestamp field.
and how do I use the target option to configure it?
thank you so much!
Set the date filter's target option to "start".
https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html#plugins-filters-date-target
Note that the start field in your index has already been mapped as a string. Once set, the mapping of a field in an index can't be changed. If possible, delete the index and start over.
it worked!
thank you so much!