Splunk Search

having a doubt in splunk query

Chandrasekhar6
Explorer
I want to change the msg for a log i.e

<list >
<Header>.....</Header>
<status>
<Message>Thuihhh_4y3y27y234yy4 is pending</Message>
</status>
</list>

to

<list >
<Header>.....</Header>
<status>
<Message>request is pending</Message>
</status>
</list>
 
how can i achieve using rex+sed commands in splunk
Labels (2)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

While @bowesmana 's solution should work be aware that working with structured data using just regexes can lead to unforeseen problems.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Try this

| rex mode=sed "s/(<Message>).*( is pending)(<\/Message>)/\1request\2\3/"

 

0 Karma
Get Updates on the Splunk Community!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

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