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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...