I want to search all documents that have a field "logLevel" set to "WARNING" in the last 24 hours. How do I have to format this query for _search or python elasticsearch? This is my current query:
"query":
{
"term": {"logLevel": "WARNING"},
"range": {
"timestamp": {
"gte": "now-1d/d",
"lt": "now/d"
}
}
}
The error message is:
'parsing_exception', '[term] malformed query, expected [END_OBJECT] but found [FIELD_NAME]'
Thanks!