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

Comments

Projects
None yet
3 participants
@kroepke
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 from Add pipeline function support for integer to IPv4 support to Add pipeline function support for integer to IPv4 conversion Nov 6, 2018

kroepke added a commit that referenced this issue Nov 6, 2018

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

bernd added a commit that referenced this issue Nov 23, 2018

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

@bernd bernd closed this in #5269 Nov 23, 2018

bernd added a commit that referenced this issue Nov 23, 2018

Add support for decimal IPv4 representation in to_ip pipeline function (
#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

Add support for decimal IPv4 representation in to_ip pipeline functio…
…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@8e77a4d

edmundoa added a commit to Graylog2/graylog-plugin-pipeline-processor that referenced this issue Nov 23, 2018

Add support for decimal IPv4 representation in to_ip pipeline functio…
…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@8e77a4d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment