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!

Splunk Smartness with Brandon Sternfield | Episode 3

Hello and welcome to another episode of "Splunk Smartness," the interview series where we explore the power of ...

Monitoring Postgres with OpenTelemetry

Behind every business-critical application, you’ll find databases. These behind-the-scenes stores power ...

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 ...