有以下数据,如何统计 statuscode 中 400(403,404 看做400)和 500(503,505 看做500)的数量?
能用聚合实现最好,不能用聚合其他方式只要能得到预期结果就行。
求大佬们不吝赐教。
[
{
"statuscode": "200",
"method": "GET",
"reqtime": 4265,
"url": "http://www.baidu.com/news/2017 ... ot%3B
},
{
"statuscode": "400",
"method": "GET",
"reqtime": 29009,
"url": "http://www.baidu.com/news/2017 ... ot%3B
},
{
"statuscode": "404",
"method": "get",
"reqtime": 3632,
"url": "http://www.baidu.com/"
},
{
"statuscode": "403",
"method": "GET",
"reqtime": 4560,
"url": "http://www.baidu.com/news/2017 ... ot%3B
},
{
"statuscode": "200",
"method": "GET",
"reqtime": 9217,
"url": "http://www.baidu.com/news/2017 ... ot%3B
},
{
"statuscode": "503",
"method": "GET",
"reqtime": 3237,
"url": "http://www.baidu.com/news/2017 ... ot%3B
},
{
"statuscode": "505",
"method": "GET",
"reqtime": 29687,
"url": "http://www.baidu.com/news/2017 ... ot%3B
},
{
"statuscode": "500",
"method": "GET",
"reqtime": 39081,
"url": "http://www.baidu.com/news/2017 ... ot%3B
},
{
"statuscode": "200",
"method": "GET",
"reqtime": 11015,
"url": "http://www.baidu.com/news/2017 ... ot%3B
},
{
"statuscode": "200",
"method": "GET",
"reqtime": 11653,
"url": "http://www.baidu.com/news/2017 ... ot%3B
}
]
]
1 个回复
strglee
赞同来自: liulei