Skip to content

Adapt to ip range breaking changes in ES 5.0+#8740

Merged
Bargs merged 3 commits intoelastic:masterfrom
Bargs:fixIPKey
Oct 19, 2016
Merged

Adapt to ip range breaking changes in ES 5.0+#8740
Bargs merged 3 commits intoelastic:masterfrom
Bargs:fixIPKey

Conversation

@Bargs
Copy link
Contributor

@Bargs Bargs commented Oct 18, 2016

I've included fixes for two issues in this PR because you really need both to test each one fully.

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 it
appears to be a mistake that it was ever included in the first place.
So now we'll generate the key ourselves.

Fixes: #8736


The IP range agg supports open ended ranges. Elasticsearch 2.x was
lenient and accepted null as a value for the from/to props, but the
correct way to do an open ended range was always to omit the from/to
key entirely. ES 5.0 appears to be more strict and barfs when null is
passed. This commit removes the null values.

Fixes elastic#8741

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: elastic#8736
@kobelb
Copy link
Contributor

kobelb commented Oct 18, 2016

LGTM

The IP range agg supports open ended ranges. Elasticsearch 2.x was
lenient and accepted null as a value for the from/to props, but the
correct way to do an open ended range was always to omit the from/to
key entirely. ES 5.0 appears to be more strict and barfs when null is
passed. This commit removes the null values.

Fixes elastic#8741
@spalger spalger self-assigned this Oct 18, 2016
@kobelb
Copy link
Contributor

kobelb commented Oct 18, 2016

When trying to 'click through' an open ended IP range (192.168.0.0 - *) I'm getting the following error: "type":"illegal_argument_exception","reason":"'*' is not an IP string literal."

@Bargs
Copy link
Contributor Author

Bargs commented Oct 18, 2016

Hmmm, I must have missed something. Unfortunately I'm out of time tonight. I'll pick this up first thing in the morning.

@Bargs Bargs changed the title Generate key for ip range from/to agg Adapt to ip range breaking changes in ES 5.0+ Oct 18, 2016
@spalger
Copy link
Contributor

spalger commented Oct 19, 2016

Sent you a couple tweaks in Bargs#2 if you wouldn't mind taking a look

@Bargs
Copy link
Contributor Author

Bargs commented Oct 19, 2016

This is the bug that keeps on giving #8751

@Bargs
Copy link
Contributor Author

Bargs commented Oct 19, 2016

whoops, test failure, looking

* updated the filter labels to match the range labels
* fixed the filter creation to work for unbound ranges
@Bargs
Copy link
Contributor Author

Bargs commented Oct 19, 2016

Tests fixed, ready for review

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kobelb
Copy link
Contributor

kobelb commented Oct 19, 2016

LGTM

@Bargs Bargs merged commit 7cbd3a6 into elastic:master Oct 19, 2016
elastic-jasper added a commit that referenced this pull request Oct 19, 2016
---------

**Commit 1:**
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: #8736

* Original sha: f344a4b
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-10-18T22:51:56Z

**Commit 2:**
Stop sending null in ip range from/to props

The IP range agg supports open ended ranges. Elasticsearch 2.x was
lenient and accepted null as a value for the from/to props, but the
correct way to do an open ended range was always to omit the from/to
key entirely. ES 5.0 appears to be more strict and barfs when null is
passed. This commit removes the null values.

Fixes #8741

* Original sha: 3ca45ba
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-10-18T23:18:14Z

**Commit 3:**
ip range label and filter improvements

* updated the filter labels to match the range labels
* fixed the filter creation to work for unbound ranges

* Original sha: b153ea0
* Authored by Spencer <spalger@users.noreply.github.com> on 2016-10-19T17:57:58Z
* Committed by Matthew Bargar <mbargar@gmail.com> on 2016-10-19T18:36:22Z
spalger pushed a commit that referenced this pull request Oct 19, 2016
---------

**Commit 1:**
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: #8736

* Original sha: f344a4b
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-10-18T22:51:56Z

**Commit 2:**
Stop sending null in ip range from/to props

The IP range agg supports open ended ranges. Elasticsearch 2.x was
lenient and accepted null as a value for the from/to props, but the
correct way to do an open ended range was always to omit the from/to
key entirely. ES 5.0 appears to be more strict and barfs when null is
passed. This commit removes the null values.

Fixes #8741

* Original sha: 3ca45ba
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-10-18T23:18:14Z

**Commit 3:**
ip range label and filter improvements

* updated the filter labels to match the range labels
* fixed the filter creation to work for unbound ranges

* Original sha: b153ea0
* Authored by Spencer <spalger@users.noreply.github.com> on 2016-10-19T17:57:58Z
* Committed by Matthew Bargar <mbargar@gmail.com> on 2016-10-19T18:36:22Z
Bargs pushed a commit that referenced this pull request Oct 19, 2016
Bargs pushed a commit that referenced this pull request Oct 19, 2016
@epixa epixa added v5.1.1 and removed v5.1.0 labels Dec 8, 2016
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
---------

**Commit 1:**
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: elastic#8736

* Original sha: 4ce57ac7ddde0c889741d26dbbfe30440a0fc5fb [formerly f344a4b]
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-10-18T22:51:56Z

**Commit 2:**
Stop sending null in ip range from/to props

The IP range agg supports open ended ranges. Elasticsearch 2.x was
lenient and accepted null as a value for the from/to props, but the
correct way to do an open ended range was always to omit the from/to
key entirely. ES 5.0 appears to be more strict and barfs when null is
passed. This commit removes the null values.

Fixes elastic#8741

* Original sha: 70426f51c074459821730a8afcd0771f97eb9752 [formerly 3ca45ba]
* Authored by Matthew Bargar <mbargar@gmail.com> on 2016-10-18T23:18:14Z

**Commit 3:**
ip range label and filter improvements

* updated the filter labels to match the range labels
* fixed the filter creation to work for unbound ranges

* Original sha: f3f4fea563b229a9e655b0aa1a9803f3ee7b3091 [formerly b153ea0]
* Authored by Spencer <spalger@users.noreply.github.com> on 2016-10-19T17:57:58Z
* Committed by Matthew Bargar <mbargar@gmail.com> on 2016-10-19T18:36:22Z


Former-commit-id: c248419
airow pushed a commit to airow/kibana that referenced this pull request Feb 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IP range agg returns error with open ended ranges Visualization IPv4 Range Aggregation

4 participants

Comments