Skip to content

Instantly share code, notes, and snippets.

@markuskont
Last active January 6, 2017 11:21
Show Gist options
  • Save markuskont/4e6fcf0eb073c77731b75b89d4300537 to your computer and use it in GitHub Desktop.
Save markuskont/4e6fcf0eb073c77731b75b89d4300537 to your computer and use it in GitHub Desktop.
{
"query": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"gte": "now-7d/d",
"lt": "now/d"
}
}
},
{
"term": {
"event_type": {
"value": "alert"
}
}
},
{
"term": {
"alert.severity": {
"value": 1
}
}
},
{
"wildcard": {
"alert.category.keyword": {
"value": "*Web*"
}
}
}
],
"must_not": [
{
"term": {
"src_geoip.country_iso_code.keyword": {
"value": "EE"
}
}
}
]
}
},
"aggs": {
"topHost": {
"terms": {
"field": "http.hostname.keyword",
"size": 25
},
"aggs": {
"SignificantURL": {
"significant_terms": {
"field": "http.url.keyword"
},
"aggs": {
"topSrc": {
"terms": {
"field": "src_ip.keyword",
"size": 10
}
}
}
}
}
},
"topCountry": {
"terms": {
"field": "src_geoip.country_iso_code.keyword",
"size": 10
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment