mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Generate key for ip range from/to agg
Elasticsearch 5.0 no longer returns a `key` prop with ip range buckets when from/to is used in the request. Looking at the [2.x docs][1] it appears to be a mistake that it was ever included in the first place. So now we'll generate the key ourselves. [1]: https://www.elastic.co/guide/en/elasticsearch/reference/2.4/search-aggregations-bucket-iprange-aggregation.html Fixes: https://github.com/elastic/kibana/issues/8736
This commit is contained in:
parent
e9363d21d0
commit
f344a4b262
1 changed files with 7 additions and 0 deletions
|
@ -13,6 +13,13 @@ export default function RangeAggDefinition(Private) {
|
|||
name: 'ip_range',
|
||||
title: 'IPv4 Range',
|
||||
createFilter: createFilter,
|
||||
getKey: function (bucket, key, agg) {
|
||||
if (key) return key;
|
||||
|
||||
const from = _.get(bucket, 'from', '*');
|
||||
const to = _.get(bucket, 'to', '*');
|
||||
return `${from}-${to}`;
|
||||
},
|
||||
makeLabel: function (aggConfig) {
|
||||
return aggConfig.getFieldDisplayName() + ' IP ranges';
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue