使用netstat -lntp来看看有侦听在网络某端口的进程。当然,也可以使用 lsof。

请教下大家,es按照时间统计问题

Elasticsearch | 作者 zareca | 发布于2018年02月28日 | 阅读数:2578

比如一月30天中,我需要按时间去统计10号到30号之间每天的数据量,但是10号那天需要是1号到10的总量,后面每天的量加上前一天的量。我是想在一个查询里面去完成,但是现在不知道如何去获取1号到10号的总量,下面是我的查询语句。
{
"size" : 0,
"query" : {
"bool" : {
"must" : [
{
"match_phrase" : {
"orgId" : {
"query" : "144fcda2-ce6a-11e7-9f65-d4ae527bf13a",
"slop" : 0,
"boost" : 1.0
}
}
}
],
"filter" : [
{
"terms" : {
"sealStatus" : [
1,
2,
3
],
"boost" : 1.0
}
},
{
"range" : {
"sealCreateDate" : {
"from" : "2018-01-10 00:00:00",
"to" : "2018-01-30 23:59:59",
"include_lower" : true,
"include_upper" : true,
"format" : "yyyy-MM-dd HH:mm:ss",
"boost" : 1.0
}
}
}
],
"disable_coord" : false,
"adjust_pure_negative" : true,
"boost" : 1.0
}
},
"aggregations" : {
"sealCount" : {
"filters" : {
"filters" : [
{
"term" : {
"sealType" : {
"value" : 1,
"boost" : 1.0
}
}
},
{
"term" : {
"sealType" : {
"value" : 2,
"boost" : 1.0
}
}
}
],
"other_bucket" : false,
"other_bucket_key" : "_other_"
},
"aggregations" : {
"aggs-signDate" : {
"date_histogram" : {
"field" : "sealCreateDate",
"format" : "yyyy-MM-dd",
"interval" : "1d",
"offset" : 0,
"order" : {
"_key" : "asc"
},
"keyed" : false,
"min_doc_count" : 0,
"extended_bounds" : {
"min" : "2018-01-10",
"max" : "2018-01-30"
}
},
"aggregations" : {
"doc_count" : {
"sum" : {
"field" : "orgStatus"
}
},
"totalCount" : {
"cumulative_sum" : {
"buckets_path" : [
"doc_count"
]
}
}
}
}
}
}
}
}
已邀请:

要回复问题请先登录注册