Splunk Search

Remove colons from a number

dsmeerkat
Explorer

I'm looking to get rid of the numbers and colon before the larger one in the middle, and after

I have

1:31705:1
1:19439:8
1:19438:13

What I would like is

31705
19439
19438

Tags (1)
0 Karma
1 Solution

xpac
SplunkTrust
SplunkTrust

Try this:

| rex field=yourfield "^[^:]+:(?<yourfield>[^:]+):"

Hope that helps - if it does I'd be happy if you would upvote/accept this answer, so others could profit from it. 🙂

View solution in original post

xpac
SplunkTrust
SplunkTrust

Try this:

| rex field=yourfield "^[^:]+:(?<yourfield>[^:]+):"

Hope that helps - if it does I'd be happy if you would upvote/accept this answer, so others could profit from it. 🙂

Get Updates on the Splunk Community!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...