Lucene regex to filter out timestamp containing "23:59:59" only


I have an Elasticsearch data source pointing to an index with 2 fields – a value (integer) and a timestamp (date). My intention is to use the value field in metric (sum) for only those documents which has “23:59:59.999” in the timestamp.

I am trying to create a variable like – {“find”: “terms”, “field”: “timestamp”, “query”: “”} with a regex to filter only those timestamps which has “23:59:59.999” for any dates.

Can you help me with the regex that I should use?


Apparently regex will not work on Date type fields. Is there a way I can use functions like ‘hourOfDay’ in main query as a filter… or in a group by filter to apply on the data set before going for sum or count metric?

Any help is appreciated.