Hello, I have a date in log file like this one 2017-01-01 07:57:22 , I want to extract only the month and the day 01-01, using a logstash filter, then use it as Kibana's timestamp.
You haven't really described what the problem is so it's hard to help. Have you configured the index pattern in Kibana to use timestamp as the timestamp field?
I edited the post, added the logstash config file.
Yes, but that's not what I asked for. I understand what you want, but you're not telling us what you currently get. Is the timestamp field not populated with the parsed timestamp? Does it have the wrong timezone? Is it correctly populated but Kibana ignores it?
How can I achieve this?
In the Kibana settings there's a dropdown for choosing the timestamp field for a particular index pattern. If you don't want to use the default @timestamp field (which Logstash is going to send anyway) you have to tell Kibana which field to use.
Why not stick with @timestamp until you're more comfortable with the stack?
Is the timestamp field not populated with the parsed timestamp? Does it have the wrong timezone? Is it correctly populated but Kibana ignores it?
Yes, precisely.
My extracted field exists with the correct values, but Kibana doesn't read it into its @timestamp field.
In the Kibana settings there's a dropdown for choosing the timestamp field for a particular index pattern. If you don't want to use the default @timestamp field (which Logstash is going to send anyway) you have to tell Kibana which field to use.
Ah, I got it, but it only shows the default @timestamp field, maybe because my extracted field is parsed as a string not a date?
Why not stick with @timestamp until you're more comfortable with the stack?
Problem is my extracted timestamp is different from the default one, the default one is the time when I indexed the logfile, I don't want this.
My extracted field exists with the correct values, but Kibana doesn't read it into its @timestamp field.
No, because you're storing the parsed timestamp in the timestamp field instead of in @timestamp. Remove the target option for your date filter so that you store it in @timestamp.
Ah, I got it, but it only shows the default @timestamp field, maybe because my extracted field is parsed as a string not a date?
The _dateparsefailure tag indicates that the date filter failed. Your Logstash logs will tell you why, but without looking I see that your date pattern isn't matching the input. You don't have any milliseconds in your timestamp field so you need to delete ",SSS" from your date pattern.
If all my events are within 2017 for example, I think it would be redundant and somehow boring to keep mentioning the year in the visualizations, don't you agree?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.