0
我試圖創建一個查詢來計算在最後一天滿足兩個條件的情況。具有多個條件和時間範圍的Elasticsearch查詢
該查詢顯示了這兩個條件的計數,但是當我嘗試添加一個範圍,它似乎符合所有文件:
GET logstash-*/_count
{
"query": {
"bool": {
"should": [
{
"match": {
"rawmsg": {
"query": "Could not send Message.",
"type": "phrase"
}
}
},
{
"match": {
"stack_trace": {
"query": "*WebServiceException*",
"type": "phrase"
}
}
}
]
}
}
}
以下是我正在試圖加入日期範圍:
GET logstash-*/_count
{
"query": {
"bool": {
"should": [
{
"match": {
"rawmsg": {
"query": "Could not send Message.",
"type": "phrase"
}
}
},
{
"match": {
"stack_trace": {
"query": "*WebServiceException*",
"type": "phrase"
}
}
},
{
"range" : {
"@timestamp" : {
"gte" : "now-1d/d",
"lt" : "now/d"
}
}
}
]
}
}
}