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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...