Sir,
Using scripted field i am trying to extract the correct date from message field so that i can save it in a date type field and use that field instead of @timestamp field in Date Histogram Graph.
Message field contains info like date, warnings,progress etc
It's format is
2019-01-18 12:49:45.231 Progress: Targets : Resume
I'm using painless scripting in it.
So i'm facing error in the script part i showed in screenshot. If any more information is needed then i'll provide that too.
I did try with converting field to date type in logstash but that was not working so i was trying using scripted field.
can u help me with the painless script to extract date from message field and storing in date type scripted field. I want script for it.
Here is my script
new SimpleDateFormat('YYYY-MM-DD:HH:mm:ss.SSS').parse(doc['message'].value);
okay Sir, I tried to convert the event_timestamp field to a date type field so that logs actual time can be retrieved but event_timestamp field shows to be "string type". In order to be able to plot data histogram i need event_timestamp field to be a date type which i am not able to convert.
The config above stores the timestamp in the @timestamp field, so this is what you should use when building your visualisation. If you instead want to store it in the existing event_timestamp field, you need to set this as target in your date filter.
sir, I created a new index still its giving me event_timestamp field as string only. Is there anymore changes required in my logstash config file?
or any other way is there to convert string type to date type field.
while running logstash i'm getting an error
"Detected a 6.x and above cluster: the type event field won't be used to determine the document _type {:es_version=>6}"
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.