所以我有3种在我Elasticsearch日志首页 -Elasticsearch - 获取日志类型的数量在过去24小时内
CA,CT,和ACC
我想查询Elasticsearch获得在通话之前的24小时每个人的数量,但我没有多少运气结合起来。
调用
10.10.23.45:9200/filebeat-*/_count
随着
{
"query":{
"term": {"type":"ct"}
}
}
获取我的计数,但尝试添加时间范围已被证明是徒劳的。当我尝试将范围添加到相同的查询 - 这是行不通的
我试着使用:
{
"query":{
"term": {"type":"ct"},
"range":{
"date":{
"gte": "now-1d/d",
"lt" : "now"
}
}
}
}
但返回
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[term] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
"line": 5,
"col": 3
}
],
"type": "parsing_exception",
"reason": "[term] malformed query, expected [END_OBJECT] but found [FIELD_NAME]",
"line": 5,
"col": 3
},
"status": 400
}
这似乎并不很为我 - 我有工作下面回来了 - 当我为相同的数据做一个数,我得到:6071579 { \t “花”:4, \t “TIMED_OUT”:假的, \t “_shards”:{ \t \t“TOT人“:32, \t \t ”成功“:32, \t \t ”失败“:0 \t}, \t ”命中“:{ \t \t ”总“:0, \t \t ”MAX_SCORE“:空, \t \t“hits”:[] \t} } –