Reputation: 32296
This is the query kibana has generated and it works as expected. But I want to add one more where clause to the query. The eventname should not start with "Describe" or "List".
{
"size": 0,
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "*",
"analyze_wildcard": true
}
},
{
"range": {
"@timestamp": {
"gte": 1490867646696,
"lte": 1493459646696,
"format": "epoch_millis"
}
}
}
],
"must_not": []
}
},
"_source": {
"excludes": []
},
"aggs": {
"2": {
"terms": {
"field": "eventName.keyword",
"size": 5000,
"order": {
"_count": "desc"
}
}
}
}
}
Update: I am not sure if this will correctly exclude the records.
"must_not": [
{
"prefix" : { "eventName.keyword" : "Describe" }
},
{
"prefix" : { "eventName.keyword" : "List" }
}
]
How to get this query back into kibana?
Upvotes: 0
Views: 128
Reputation: 4883
You can achieve the expected results either of following ways:
Method-1: Customizing existing query_string query
Replace default query_string
query *
from Kibana search bar with following query string:
!(eventName.keyword: Describe* OR eventName.keyword: List*)
Method-2: Adding filters in Kibana
`
{
"query": {
"bool": {
"must_not": [
{
"prefix": {
"eventName.keyword": "Describe"
}
},
{
"prefix": {
"eventName.keyword": "List"
}
}
]
}
}
}
`
Upvotes: 1