How to query based on month name

Hi ,

Is there any way to pass month name for timestamp field to query the data for a specific month ?

Like suppose I want to query some data for entire march month currently I am passing the timestamp in the following way:

"range": { "@timestamp": { "gte": 1551378600000, "lte": 1554056999999, "format": "epoch_millis" } }

Is there any other straight forward way to pass month name directly ?

Thanks
Niraj

hey,

you can change the format to resemble a string based date like 2019-03-01 and 2019-03-31 which will make it much easier to write a human readable query.

See https://www.elastic.co/guide/en/elasticsearch/reference/7.0/mapping-date-format.html

--Alex

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.