I searched a lot but couldn't able to write a proper KQL. I am trying to search a string "error
" in message
field AND field kubernetes.pod.name
must contain test-*
I tried this but it's not working
{
"size": 1,
"query": {
"bool": {
"must": [
{
"match": {
"message": {
"query": "error",
"operator": "OR",
"prefix_length": 0,
"max_expansions": 50,
"fuzzy_transpositions": true,
"lenient": false,
"zero_terms_query": "NONE",
"auto_generate_synonyms_phrase_query": true,
"boost": 1
}
}
},
{
"match": {
"kubernetes.pod.name": {
"query": "test-*",
"operator": "OR",
"prefix_length": 0,
"max_expansions": 50,
"fuzzy_transpositions": true,
"lenient": false,
"zero_terms_query": "NONE",
"auto_generate_synonyms_phrase_query": true,
"boost": 1
}
}
},
{
"range": {
"@timestamp": {
"from": "now-10000m",
"to": null,
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"sort": [
{
"@timestamp": {
"order": "desc"
}
}
]
}