Hello there,
I'm having some problems with querying in Kibana, so I tried to create manual query using the /_search API.
My index template is composed of .alerts-ecs-mappings
, logs-mappings
and logs-settings
component templates.
Running a query like below returns an empty result.
{
"query": {
"bool": {
"must": [],
"filter": [
{
"range": {
"@timestamp": {
"format": "strict_date_optional_time",
"gte": "2022-08-03T00:00:00.000Z",
"lte": "2022-08-05T11:04:27.086Z"
}
}
},
{
"match":{
"labels.job_type": "repair"
}
}
],
"should": [],
"must_not": []
}
}
}
But removing either the range
or match
parts returns expected results. If I add some other filters on ECS fields, eg. log.level
or event.action
, then I get results, but as soon as I combine any labels.*
and @timestamp
, then result is empty.
I'm getting pretty desperate, because we use elastic and kibana to store logs and this means, that basically I cannot do any filters on our logs.
Any tips what could cause this behaviour?