I'm using version 5.2.2. I also pasted response for one point of data as an example, but I can paste more, almost all data is dummy.
Visualization export:
[
{
"_id": "a5561cc0-0ed0-11e7-bb36-cfca88d9d1a6",
"_type": "visualization",
"_source": {
"title": "packet_loss",
"visState": "{\"title\":\"packet_loss\",\"type\":\"line\",\"params\":{\"addLegend\":true,\"addTimeMarker\":false,\"addTooltip\":true,\"defaultYExtents\":false,\"drawLinesBetweenPoints\":true,\"interpolate\":\"linear\",\"legendPosition\":\"bottom\",\"radiusRatio\":9,\"scale\":\"linear\",\"setYExtents\":false,\"showCircles\":false,\"times\":[]},\"aggs\":[{\"id\":\"1\",\"enabled\":true,\"type\":\"max\",\"schema\":\"metric\",\"params\":{\"field\":\"loss\"}},{\"id\":\"2\",\"enabled\":true,\"type\":\"date_histogram\",\"schema\":\"segment\",\"params\":{\"field\":\"stamp_inserted\",\"interval\":\"auto\",\"customInterval\":\"2h\",\"min_doc_count\":1,\"extended_bounds\":{}}},{\"id\":\"3\",\"enabled\":true,\"type\":\"max\",\"schema\":\"metric\",\"params\":{\"field\":\"treshold_loss\",\"customLabel\":\"Treshold\"}}],\"listeners\":{}}",
"uiStateJSON": "{\"vis\":{\"colors\":{\"Max loss\":\"#BF1B00\",\"Average treshold_loss\":\"#58140C\",\"Treshold\":\"#58140C\"}}}",
"description": "",
"savedSearchId": "7ba014f0-0ece-11e7-8cf4-2f3c2fc6a19e",
"version": 1,
"kibanaSavedObjectMeta": {
"searchSourceJSON": "{\"filter\":[]}"
}
}
}
]
Request:
{
"size": 0,
"aggs": {
"2": {
"date_histogram": {
"field": "stamp_inserted",
"interval": "1s",
"time_zone": "Europe/Berlin",
"min_doc_count": 1
},
"aggs": {
"1": {
"max": {
"field": "loss"
}
},
"3": {
"max": {
"script": {
"inline": "0.01",
"lang": "painless"
}
}
}
}
}
},
"highlight": {
"pre_tags": [
"@kibana-highlighted-field@"
],
"post_tags": [
"@/kibana-highlighted-field@"
],
"fields": {
"*": {}
},
"require_field_match": false,
"fragment_size": 2147483647
},
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "peer_ip_src:[EDITED]",
"analyze_wildcard": true
}
},
{
"range": {
"stamp_inserted": {
"gte": 1490105400000,
"lte": 1490105700000,
"format": "epoch_millis"
}
}
}
],
"must_not": []
}
},
"_source": {
"excludes": []
}
}
Response:
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 0,
"hits": []
},
"aggregations": {
"2": {
"buckets": [
{
"1": {
"value": 0
},
"3": {
"value": 0.01
},
"key_as_string": "2017-03-21T15:12:09.000+01:00",
"key": 1490105529000,
"doc_count": 1
}
]
}
},
"status": 200
}
Actual data from the Search:
{
"_index": "netflow",
"_type": "netflow_data",
"_id": "[EDITED]",
"_score": null,
"_source": {
"iface_in": 11,
"iface_out": 200,
"peer_ip_src": "[EDITED]",
"ip_src": "[EDITED]",
"nbar_name": "rtp-audio",
"class_dscp": 0,
"ip_dst": "[EDITED]",
"packets": 2358803,
"loss": 0.0491,
"jitter": 47711,
"delay": 276,
"@timestamp": "2017-03-22T07:07:36.304Z",
"stamp_inserted": "2017-03-21T14:12:09.000Z",
"flows": 5,
"bytes": 1412937895,
"@version": "1",
"tos": 0
},
"fields": {
"treshold_loss": [
0.01
],
"@timestamp": [
1490166456304
],
"treshold_jitter": [
30
],
"stamp_inserted": [
1490105529000
],
"treshold_delay": [
150
]
},
"sort": [
1490105529000
]
}