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"
}
}
}
]
}
}
}