Getting Data In

How do I clear 0s from the Ip?

noott211
Path Finder

But the log says 017.002.100.103. I am receiving data from universal forwarder and I would like to remove 0 in front of me Is there a way?

i want 17.2.100.103

Tags (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| makeresults | eval ip="017.002.100.103" 
| eval ip=replace(ip,"(^|\.)(0*)(\d+)","\1\3")

View solution in original post

0 Karma

somesoni2
Revered Legend

In search, you can do something like this

| makeresults | eval ip="017.002.100.103" 
| eval ip=replace(ip,"^0*(.+)","\1") 
0 Karma

noott211
Path Finder

The command is removed only at the beginning I want every part of it

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| makeresults | eval ip="017.002.100.103" 
| eval ip=replace(ip,"(^|\.)(0*)(\d+)","\1\3")
0 Karma
Get Updates on the Splunk Community!

Exporting Splunk Apps

Join us on Monday, October 21 at 11 am PT | 2 pm ET!With the app export functionality, app developers and ...

Cisco Use Cases, ITSI Best Practices, and More New Articles from Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Build Your First SPL2 App!

Watch the recording now!.Do you want to SPL™, too? SPL2, Splunk's next-generation data search and preparation ...