Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pipeline function support for integer to IPv4 conversion #5268

Closed
kroepke opened this issue Nov 6, 2018 · 0 comments · Fixed by #5269
Closed

Add pipeline function support for integer to IPv4 conversion #5268

kroepke opened this issue Nov 6, 2018 · 0 comments · Fixed by #5269

Comments

@kroepke
Copy link
Member

kroepke commented Nov 6, 2018

Some systems represent IPv4 addresses in their decimal representation.
Currently the to_ip function only supports the string representation of an IP address, but it could easily try to convert integers as well.

Expected Behavior

to_ip("5.59.95.221") == to_ip(87777245) should be true.

Current Behavior

to_ip(87777245) fails to convert the address and returns the default IP address (0.0.0.0 if not specified).

Possible Solution

Implement integer support for converting IP addresses. Only support IPv4 addresses, because we don't have bigint support and IPv6 addresses usually are given in their hex form.

Context

Forcepoint logs IP addresses this way.

@kroepke kroepke added the feature label Nov 6, 2018
@kroepke kroepke changed the title Add pipeline function support for integer to IPv4 support Add pipeline function support for integer to IPv4 conversion Nov 6, 2018
kroepke added a commit that referenced this issue Nov 6, 2018
if the argument is a number, try to convert its intValue into an IP address
otherwise the previous behavior of taking the string value and converting that applies

fixes #5268
bernd pushed a commit that referenced this issue Nov 23, 2018
if the argument is a number, try to convert its intValue into an IP address
otherwise the previous behavior of taking the string value and converting that applies

fixes #5268
bernd pushed a commit that referenced this issue Nov 23, 2018
#5269)

* support for decimal IPv4 representation in to_ip

if the argument is a number, try to convert its intValue into an IP address
otherwise the previous behavior of taking the string value and converting that applies

fixes #5268

* add clarifying comment about IPv6 support
@bernd bernd added this to the 3.0.0 milestone Nov 23, 2018
bernd added a commit to Graylog2/graylog-plugin-pipeline-processor that referenced this issue Nov 23, 2018
…n (#5269)

if the argument is a number, try to convert its intValue into an IP address
otherwise the previous behavior of taking the string value and converting that applies

Fixes Graylog2/graylog2-server#5268

Backport of Graylog2/graylog2-server@8e77a4d53
edmundoa pushed a commit to Graylog2/graylog-plugin-pipeline-processor that referenced this issue Nov 23, 2018
…n (#5269) (#253)

if the argument is a number, try to convert its intValue into an IP address
otherwise the previous behavior of taking the string value and converting that applies

Fixes Graylog2/graylog2-server#5268

Backport of Graylog2/graylog2-server@8e77a4d53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants