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!

Notification Email Migration Announcement

The Notification Team is migrating our email service provider from Postmark to AWS Simple Email Service (SES) ...

Mastering Synthetic Browser Testing: Pro Tips to Keep Your Web App Running Smoothly

To start, if you're new to synthetic monitoring, I recommend exploring this synthetic monitoring overview. In ...

Splunk Edge Processor | Popular Use Cases to Get Started with Edge Processor

Splunk Edge Processor offers more efficient, flexible data transformation – helping you reduce noise, control ...