Elasticsearch query with @timestamp range

Hi,
What am I doing wrong in my query? I'm getting response:

"reason" : "failed to parse date field [August 17th 2017, 21:59:28.000] with format [strict_date_optional_time||epoch_millis]",
"caused_by" : {
"type" : "illegal_argument_exception",
"reason" : "Invalid format: "August 17th 2017, 21:59:28.000""
}
My query looks like this:

curl -XPOST 'localhost:9200/_all/_search?pretty' -d '
{
    "query": {
        "bool": {
            "must": {
                "match": {
                    "host": "hostname"
                }
            },
            "filter": {
                "range": {
                    "@timestamp": {
                        "gte": "August 17th 2017, 21:59:28.000"
                    }
                }
            }
        }
    }
}'

My @timestamp field in kibana also looks like this. Using epoch time works.

Thanks!

1 Like

Found a solution, elasticsearch is expecting iso format ("2017-08-17T21:59:28") which worked.

Thanks,

2 Likes

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