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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...