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!

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...

Stay Connected: Your Guide to October Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...