Splunk Search

I am looking for replacing all the numbers in a field to *. Can anyone help.

Tejagorantla
New Member

Input field value: "this error occured for member123456. While making a payment of 60"
Desired input field value:"this error occured for member*. While making a payment of *"

0 Karma

acharlieh
Influencer

If you're looking for a search time solution instead of index time, one option might be rex in sed mode.

e.g.

<base search> | rex field=fieldname mode=sed "s|\d+|*|g"
0 Karma

woodcock
Esteemed Legend

Like this in props.conf on your HF/Indexer tier:

[YourSourcetypeHere]
SEDCMD-obfuscate_membernumber_and_payment = s/this error occurred for member[^\.]\.\s+ While making a payment of \d+/this error occured for member\*\. While making a payment of \*/
0 Karma
Get Updates on the Splunk Community!

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

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...