Splunk Search

Removal of unnecessary fields

kumar518g
Explorer

Hi ,
I have to remove some chars from the extracted field "UserName" values like below

ValidateCcoId - svorma1
ValidateCcoId - pauschool
i have to remove those "ValidateCcoId - " from those values please help me.

Regards
Ravi

Tags (1)

MHibbin
Influencer

You should look at the rex command... something like this should do it...

<yoursearch> | rex field="UserName" "\w+\s+\-\s+(?P<UserName>\w+)"

Hope this helps

yannK
Splunk Employee
Splunk Employee

same thing with a sed

<yoursearch> | rex mode=sed field="UserName" "s/ValidateCcoId - //g"

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