What Version of Elastic Stack are you on?
I am on 8.7 and Appears to be working correctly.
I also notice in your picture even though the legend has 4 values the actual graph only has the correct 2... perhaps a Viz bug.
Mine in 8.7 looks correct.... what version are you on?
Did you set any other settings?
I also notice in mine that the response has all the values as well so the filter must be applied after the response comes back which is a bit odd to me.
Request
{
"aggs": {
"0": {
"terms": {
"field": "http.request.body.bytes",
"order": {
"2": "desc"
},
"size": 5,
"shard_size": 25
},
"aggs": {
"1": {
"date_histogram": {
"field": "@timestamp",
"fixed_interval": "30s",
"time_zone": "America/Los_Angeles",
"extended_bounds": {
"min": 1682433656621,
"max": 1682434556621
}
},
"aggs": {
"2": {
"value_count": {
"field": "http.request.body.bytes"
}
}
}
},
"2": {
"value_count": {
"field": "http.request.body.bytes"
}
}
}
}
},
"size": 0,
"fields": [
{
"field": "@timestamp",
"format": "date_time"
},
{
"field": "event.created",
"format": "date_time"
},
{
"field": "event.ingested",
"format": "date_time"
},
{
"field": "file.accessed",
"format": "date_time"
},
{
"field": "file.created",
"format": "date_time"
},
{
"field": "file.ctime",
"format": "date_time"
},
{
"field": "file.mtime",
"format": "date_time"
},
{
"field": "process.end",
"format": "date_time"
},
{
"field": "process.entry_leader.parent.session_leader.start",
"format": "date_time"
},
{
"field": "process.entry_leader.parent.start",
"format": "date_time"
},
{
"field": "process.entry_leader.start",
"format": "date_time"
},
{
"field": "process.group_leader.start",
"format": "date_time"
},
{
"field": "process.parent.group_leader.start",
"format": "date_time"
},
{
"field": "process.parent.start",
"format": "date_time"
},
{
"field": "process.session_leader.parent.session_leader.start",
"format": "date_time"
},
{
"field": "process.session_leader.parent.start",
"format": "date_time"
},
{
"field": "process.session_leader.start",
"format": "date_time"
},
{
"field": "process.start",
"format": "date_time"
}
],
"script_fields": {},
"stored_fields": [
"*"
],
"runtime_mappings": {},
"_source": {
"excludes": []
},
"query": {
"bool": {
"must": [],
"filter": [
{
"bool": {
"minimum_should_match": 1,
"should": [
{
"match_phrase": {
"http.request.body.bytes": "5"
}
},
{
"match_phrase": {
"http.request.body.bytes": "18"
}
}
]
}
},
{
"range": {
"@timestamp": {
"format": "strict_date_optional_time",
"gte": "2023-04-25T14:40:56.621Z",
"lte": "2023-04-25T14:55:56.621Z"
}
}
}
],
"should": [],
"must_not": []
}
}
}
Reponse
{
"id": "FkI2cUJVX09sVFppMTFrcVhYT0k0akEgRm4zRTYzRnhURkNEVG0xWHRSYjlYZzoxNTg4Njk5Njk=",
"rawResponse": {
"took": 19,
"timed_out": false,
"_shards": {
"total": 51,
"successful": 51,
"skipped": 45,
"failed": 0
},
"hits": {
"total": 23366,
"max_score": null,
"hits": []
},
"aggregations": {
"0": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"1": {
"buckets": [
{
"2": {
"value": 118
},
"key_as_string": "2023-04-25T07:40:30.000-07:00",
"key": 1682433630000,
"doc_count": 118
},
{
"2": {
"value": 698
},
"key_as_string": "2023-04-25T07:41:00.000-07:00",
"key": 1682433660000,
"doc_count": 698
},
{
"2": {
"value": 626
},
"key_as_string": "2023-04-25T07:41:30.000-07:00",
"key": 1682433690000,
"doc_count": 626
},
{
"2": {
"value": 620
},
"key_as_string": "2023-04-25T07:42:00.000-07:00",
"key": 1682433720000,
"doc_count": 620
},
{
"2": {
"value": 556
},
"key_as_string": "2023-04-25T07:42:30.000-07:00",
"key": 1682433750000,
"doc_count": 556
},
{
"2": {
"value": 480
},
"key_as_string": "2023-04-25T07:43:00.000-07:00",
"key": 1682433780000,
"doc_count": 480
},
{
"2": {
"value": 546
},
"key_as_string": "2023-04-25T07:43:30.000-07:00",
"key": 1682433810000,
"doc_count": 546
},
{
"2": {
"value": 616
},
"key_as_string": "2023-04-25T07:44:00.000-07:00",
"key": 1682433840000,
"doc_count": 616
},
{
"2": {
"value": 494
},
"key_as_string": "2023-04-25T07:44:30.000-07:00",
"key": 1682433870000,
"doc_count": 494
},
{
"2": {
"value": 532
},
"key_as_string": "2023-04-25T07:45:00.000-07:00",
"key": 1682433900000,
"doc_count": 532
},
{
"2": {
"value": 566
},
"key_as_string": "2023-04-25T07:45:30.000-07:00",
"key": 1682433930000,
"doc_count": 566
},
{
"2": {
"value": 580
},
"key_as_string": "2023-04-25T07:46:00.000-07:00",
"key": 1682433960000,
"doc_count": 580
},
{
"2": {
"value": 512
},
"key_as_string": "2023-04-25T07:46:30.000-07:00",
"key": 1682433990000,
"doc_count": 512
},
{
"2": {
"value": 592
},
"key_as_string": "2023-04-25T07:47:00.000-07:00",
"key": 1682434020000,
"doc_count": 592
},
{
"2": {
"value": 464
},
"key_as_string": "2023-04-25T07:47:30.000-07:00",
"key": 1682434050000,
"doc_count": 464
},
{
"2": {
"value": 486
},
"key_as_string": "2023-04-25T07:48:00.000-07:00",
"key": 1682434080000,
"doc_count": 486
},
{
"2": {
"value": 646
},
"key_as_string": "2023-04-25T07:48:30.000-07:00",
"key": 1682434110000,
"doc_count": 646
},
{
"2": {
"value": 548
},
"key_as_string": "2023-04-25T07:49:00.000-07:00",
"key": 1682434140000,
"doc_count": 548
},
{
"2": {
"value": 614
},
"key_as_string": "2023-04-25T07:49:30.000-07:00",
"key": 1682434170000,
"doc_count": 614
},
{
"2": {
"value": 556
},
"key_as_string": "2023-04-25T07:50:00.000-07:00",
"key": 1682434200000,
"doc_count": 556
},
{
"2": {
"value": 514
},
"key_as_string": "2023-04-25T07:50:30.000-07:00",
"key": 1682434230000,
"doc_count": 514
},
{
"2": {
"value": 524
},
"key_as_string": "2023-04-25T07:51:00.000-07:00",
"key": 1682434260000,
"doc_count": 524
},
{
"2": {
"value": 636
},
"key_as_string": "2023-04-25T07:51:30.000-07:00",
"key": 1682434290000,
"doc_count": 636
},
{
"2": {
"value": 720
},
"key_as_string": "2023-04-25T07:52:00.000-07:00",
"key": 1682434320000,
"doc_count": 720
},
{
"2": {
"value": 584
},
"key_as_string": "2023-04-25T07:52:30.000-07:00",
"key": 1682434350000,
"doc_count": 584
},
{
"2": {
"value": 624
},
"key_as_string": "2023-04-25T07:53:00.000-07:00",
"key": 1682434380000,
"doc_count": 624
},
{
"2": {
"value": 523
},
"key_as_string": "2023-04-25T07:53:30.000-07:00",
"key": 1682434410000,
"doc_count": 523
},
{
"2": {
"value": 568
},
"key_as_string": "2023-04-25T07:54:00.000-07:00",
"key": 1682434440000,
"doc_count": 568
},
{
"2": {
"value": 700
},
"key_as_string": "2023-04-25T07:54:30.000-07:00",
"key": 1682434470000,
"doc_count": 700
},
{
"2": {
"value": 638
},
"key_as_string": "2023-04-25T07:55:00.000-07:00",
"key": 1682434500000,
"doc_count": 638
},
{
"2": {
"value": 714
},
"key_as_string": "2023-04-25T07:55:30.000-07:00",
"key": 1682434530000,
"doc_count": 714
}
]
},
"2": {
"value": 17595
},
"key": 18,
"doc_count": 17595
},
{
"1": {
"buckets": [
{
"2": {
"value": 12
},
"key_as_string": "2023-04-25T07:40:30.000-07:00",
"key": 1682433630000,
"doc_count": 12
},
{
"2": {
"value": 186
},
"key_as_string": "2023-04-25T07:41:00.000-07:00",
"key": 1682433660000,
"doc_count": 186
},
{
"2": {
"value": 198
},
"key_as_string": "2023-04-25T07:41:30.000-07:00",
"key": 1682433690000,
"doc_count": 198
},
{
"2": {
"value": 224
},
"key_as_string": "2023-04-25T07:42:00.000-07:00",
"key": 1682433720000,
"doc_count": 224
},
{
"2": {
"value": 218
},
"key_as_string": "2023-04-25T07:42:30.000-07:00",
"key": 1682433750000,
"doc_count": 218
},
{
"2": {
"value": 194
},
"key_as_string": "2023-04-25T07:43:00.000-07:00",
"key": 1682433780000,
"doc_count": 194
},
{
"2": {
"value": 192
},
"key_as_string": "2023-04-25T07:43:30.000-07:00",
"key": 1682433810000,
"doc_count": 192
},
{
"2": {
"value": 226
},
"key_as_string": "2023-04-25T07:44:00.000-07:00",
"key": 1682433840000,
"doc_count": 226
},
{
"2": {
"value": 174
},
"key_as_string": "2023-04-25T07:44:30.000-07:00",
"key": 1682433870000,
"doc_count": 174
},
{
"2": {
"value": 172
},
"key_as_string": "2023-04-25T07:45:00.000-07:00",
"key": 1682433900000,
"doc_count": 172
},
{
"2": {
"value": 220
},
"key_as_string": "2023-04-25T07:45:30.000-07:00",
"key": 1682433930000,
"doc_count": 220
},
{
"2": {
"value": 208
},
"key_as_string": "2023-04-25T07:46:00.000-07:00",
"key": 1682433960000,
"doc_count": 208
},
{
"2": {
"value": 228
},
"key_as_string": "2023-04-25T07:46:30.000-07:00",
"key": 1682433990000,
"doc_count": 228
},
{
"2": {
"value": 212
},
"key_as_string": "2023-04-25T07:47:00.000-07:00",
"key": 1682434020000,
"doc_count": 212
},
{
"2": {
"value": 188
},
"key_as_string": "2023-04-25T07:47:30.000-07:00",
"key": 1682434050000,
"doc_count": 188
},
{
"2": {
"value": 192
},
"key_as_string": "2023-04-25T07:48:00.000-07:00",
"key": 1682434080000,
"doc_count": 192
},
{
"2": {
"value": 168
},
"key_as_string": "2023-04-25T07:48:30.000-07:00",
"key": 1682434110000,
"doc_count": 168
},
{
"2": {
"value": 156
},
"key_as_string": "2023-04-25T07:49:00.000-07:00",
"key": 1682434140000,
"doc_count": 156
},
{
"2": {
"value": 144
},
"key_as_string": "2023-04-25T07:49:30.000-07:00",
"key": 1682434170000,
"doc_count": 144
},
{
"2": {
"value": 150
},
"key_as_string": "2023-04-25T07:50:00.000-07:00",
"key": 1682434200000,
"doc_count": 150
},
{
"2": {
"value": 192
},
"key_as_string": "2023-04-25T07:50:30.000-07:00",
"key": 1682434230000,
"doc_count": 192
},
{
"2": {
"value": 180
},
"key_as_string": "2023-04-25T07:51:00.000-07:00",
"key": 1682434260000,
"doc_count": 180
},
{
"2": {
"value": 192
},
"key_as_string": "2023-04-25T07:51:30.000-07:00",
"key": 1682434290000,
"doc_count": 192
},
{
"2": {
"value": 208
},
"key_as_string": "2023-04-25T07:52:00.000-07:00",
"key": 1682434320000,
"doc_count": 208
},
{
"2": {
"value": 206
},
"key_as_string": "2023-04-25T07:52:30.000-07:00",
"key": 1682434350000,
"doc_count": 206
},
{
"2": {
"value": 240
},
"key_as_string": "2023-04-25T07:53:00.000-07:00",
"key": 1682434380000,
"doc_count": 240
},
{
"2": {
"value": 161
},
"key_as_string": "2023-04-25T07:53:30.000-07:00",
"key": 1682434410000,
"doc_count": 161
},
{
"2": {
"value": 172
},
"key_as_string": "2023-04-25T07:54:00.000-07:00",
"key": 1682434440000,
"doc_count": 172
},
{
"2": {
"value": 172
},
"key_as_string": "2023-04-25T07:54:30.000-07:00",
"key": 1682434470000,
"doc_count": 172
},
{
"2": {
"value": 186
},
"key_as_string": "2023-04-25T07:55:00.000-07:00",
"key": 1682434500000,
"doc_count": 186
},
{
"2": {
"value": 200
},
"key_as_string": "2023-04-25T07:55:30.000-07:00",
"key": 1682434530000,
"doc_count": 200
}
]
},
"2": {
"value": 5771
},
"key": 5,
"doc_count": 5771
}
]
}
}
},
"isPartial": false,
"isRunning": false,
"total": 51,
"loaded": 51,
"isRestored": false
}