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!

3 Ways to Make OpenTelemetry Even Better

My role as an Observability Specialist at Splunk provides me with the opportunity to work with customers of ...

What's New in Splunk Cloud Platform 9.2.2406?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.2.2406 with many ...

Enterprise Security Content Update (ESCU) | New Releases

In August, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...