Skip to content

Instantly share code, notes, and snippets.

@emorisse
Created February 2, 2016 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emorisse/4f76cbbef61ed24ef89c to your computer and use it in GitHub Desktop.
Save emorisse/4f76cbbef61ed24ef89c to your computer and use it in GitHub Desktop.
Aggregated histogram with filters for elasticsearch
{
"aggs" : {
"messages" : {
"filters" : {
"filters" : {
"192.168.0.3" : { "term" : { "rsyslog.fromhost-ip" : "192.168.0.3" }},
"192.168.0.4" : { "term" : { "rsyslog.fromhost-ip" : "192.168.0.4" }},
"192.168.0.5" : { "term" : { "rsyslog.fromhost-ip" : "192.168.0.5" }},
"192.168.0.6" : { "term" : { "rsyslog.fromhost-ip" : "192.168.0.6" }},
"192.168.0.7" : { "term" : { "rsyslog.fromhost-ip" : "192.168.0.7" }},
"192.168.0.8" : { "term" : { "rsyslog.fromhost-ip" : "192.168.0.8" }}
}
},
"aggs" : {
"daily" : {
"date_histogram" : {
"field" : "rsyslog.timegenerated",
"interval" : "day"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment