Splunk Search

How can I do a find/replace on the results found to make them more readable?

dlespron
Path Finder

For instance, I have a log that returns many results and in between different fields I have a \x1 that I would like to replace with a space in order to make it more readable to the user. How can I tell splunk to find all the instances of \x1 and replace them with a space? Any input would be greatly appreciated!

Thanks!

Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

In the search query (search time)

<your base search> | rex mode=sed "s/x1/ /g"

Index time (props.conf)

[yoursourcetype]
SEDCMD-changex1 = s/x1/ /g

View solution in original post

somesoni2
Revered Legend

In the search query (search time)

<your base search> | rex mode=sed "s/x1/ /g"

Index time (props.conf)

[yoursourcetype]
SEDCMD-changex1 = s/x1/ /g

dlespron
Path Finder

done thanks!

0 Karma

somesoni2
Revered Legend

Glad it helped. Please mark the question answered if everything looks good.

0 Karma

dlespron
Path Finder

that works great, thanks!

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Try '| rex mode=sed "s/x1/ /g"'.

---
If this reply helps you, Karma would be appreciated.

dlespron
Path Finder

awesome, that worked great! thanks so much for your help!

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...