Splunk Search

HowTo handle DHCP Log reverse IP addresses

tyralla
New Member

Hi,

I'm looking for a possibility to join DHCP events together with transaction command. Join fields are IP and MAC address.

Unfortunately DHCP Log contains in some cases the IP in reverse.
As an example:

TIMESTAMP,DNS Update Request,66.1.168.192,MachinName,,

Correct IP in this case would be 192.168.1.66.

Is there any way to reverse the IP to allow matching with the rest of the IP entries in this field?

Thanks!

Tags (1)
0 Karma
1 Solution

Ayn
Legend

Yeah I've seen that too, Microsoft's DHCP server seems to have a weird behaviour with that.

If you have the original IP in a field, let's call it ip, you could reorder the octets with a rex statement.

... | rex mode=sed field=ip "s/(\d+)\.(\d+)\.(\d+)\.(\d+)/\4.\3.\2.\1/"

View solution in original post

Ayn
Legend

Yeah I've seen that too, Microsoft's DHCP server seems to have a weird behaviour with that.

If you have the original IP in a field, let's call it ip, you could reorder the octets with a rex statement.

... | rex mode=sed field=ip "s/(\d+)\.(\d+)\.(\d+)\.(\d+)/\4.\3.\2.\1/"

tyralla
New Member

Works perfect - Thanks!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...