一、排除
1.排除合作网站跳转的请求,例如http://www.ranshao.com
2.排除公司域名之间跳转的请求,使用wildcard通配符匹配*.company.com
二、匹配
1.匹配存在值为http大头的http_referer
三、聚合
1. 根据request.keyword进行聚合
四、最后,如果查询到某个request存在大量请求,根据业务具体情况,再进一步判断求是否应该屏蔽某些http_referer的请求。
{
"size": 0,
"query": {
"bool": {
"must_not": [
{
"match": {
"http_referrer": "http://www.ranshao.com"
}
},
{
"wildcard": {
"http_referrer": {
"value": "*.company.com"
}
}
}
],
"must": [
{
"wildcard": {
"http_referrer": {
"value": "http*"
}
}
},
{
"match": {
"status.keyword": "200"
}
},
{
"range": {
"@timestamp": {
"gte": "2019-02-01T00:00:00.000000000+00:00",
"lte": "2019-02-01T01:30:00.000000000+00:00"
}
}
}
]
}
},
"aggs": {
"cdn_huiyuan": {
"terms": {
"field": "request.keyword",
"size": 100
}
}
}
}