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!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...