I am using ELK GA 5.0.0. I have a field logtime, which contains date and time, and I would like to create a scripted field containing only time (or date), for that I made a Date scripted field showing the time alone. The settings are like below;
Language -> Painless
Type -> Date
Format -> Date
moment.js format pattern -> HH:mm:ss
Popularity -> 0
Script ->
def dateFormat = new SimpleDateFormat("HH:mm:ss");
return dateFormat.format(doc['logtime'].value);
What I am trying to accomplish is to get a field with value like 23:59:59, but I am getting an error in Discover, like Invalid date for date field. How can I fix this?
An alternate solution to creating a scripted field would be to go the Management tab and change the format of the desired field in the respective index.
Hi @cjcenizal agrred. But, if I make it a "string", will I be able to pick it as date histogram (first column in my table visualization) and sort my table based on that?
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.