I am very new to advanced searching with Elasticsearch, and mostly use Kibana.
In Kibana, I can do a simple search like this:
type:apache_access
That turns into this request:
{
"version": true,
"size": 500,
"sort": [
{
"@timestamp": {
"order": "desc",
"unmapped_type": "boolean"
}
}
],
"_source": {
"excludes": []
},
"aggs": {
"2": {
"date_histogram": {
"field": "@timestamp",
"interval": "10m",
"time_zone": "America/Los_Angeles",
"min_doc_count": 1
}
}
},
"stored_fields": [
"*"
],
"script_fields": {},
"docvalue_fields": [
{
"field": "@timestamp",
"format": "date_time"
}
],
"query": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"gte": 1613652915536,
"lte": 1613696115536,
"format": "epoch_millis"
}
}
}
],
"filter": [
{
"bool": {
"should": [
{
"match": {
"type": "apache_access"
}
}
],
"minimum_should_match": 1
}
}
],
"should": [],
"must_not": []
}
},
"highlight": {
"pre_tags": [
"@kibana-highlighted-field@"
],
"post_tags": [
"@/kibana-highlighted-field@"
],
"fields": {
"*": {}
},
"fragment_size": 2147483647
}
}
What I would like to do is the equivalent of a MySQL GROUP BY
on the field clientip
, (or maybe clientip.keyword
??) My goal is to see which IP addresses show up the most in the access logs in a given timeframe.
Kibana does this for me in the UI, with its "Top 5 values in 500 / 500 records" feature, but that's only for the top 500 values. I want the aggregate of the entire time period.