Currently all my documents in my index contain the CleanDate field which is date type:
{"CleanDate" : "2020-04-24T05:42:00.000Z"}
My documents are being shipped into elasticsearch every minute.
Is there a way for me to include a filter on visualizations/dashboard to only include documents with CleanDate that are multiples of 5minutes?
I have tried filtering by scripted fields as below:
return doc['CleanDate'].value.getMinute();
This does return the minute, however when I try to filter them using the filter UI icon, no records show up.
I've also tried using the following scripted field as per documentation to no luck: return doc['CleanDate'].date.minuteOfHour;
This does not return anything -
I'm just guessing at that point, but did you try to use multiple filters like this?
That wouldn't work, because these filters are connected by "AND"s - each document has to match all of them. As no document can have both value 28 and 30 as "minute", no results show up.
I recommend the following - create a scripted field of type boolean called is5MinuteMultiple with the following script:
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.