Answer the question
In order to leave comments, you need to log in
How to write queries with special characters in ElasticSearch?
Hello. Question in the following, it is necessary to select the data it is admissible for the last 10 minutes. There are services that are called. It is necessary to group by these services and count the number of their outputs, as well as add the number of errors that are found through the filter. The filter uses special characters and is not searched for by them. ES ignores them. An example of what is already there:
GET _search?
{
"query": {
"filtered": {
"query": {
"query_string": {
"query": "*"
}
},
"filter": {
"bool": {
"must": [
{
"range": {
"datetime": {
"gte": "now-10m",
"lte": "now"
}
}
}
]
}
}
}
},
"size": 0,
"aggs": {
"services": {
"terms": {
"field": "info.raw",
"size": 500,
"order": {
"myerrors": "desc"
}
},
"aggs": {
"myerrors": {
"filter": {
"query": {
"query_string": {
"analyzer": "whitespace",
"query": "error-3"
}
}
}
}
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question