Splunk Search

How do I write a search to replace an asterisk character in a string?

szabados
Communicator

I want to replace the * character in a string with the replace command. How do I apply the * by escaping it, not to replace the whole string?

0 Karma

chimell
Motivator

Hi
You can use rex command with mode=sed attribute . see the following

 ..........................| rex mode=sed "s/\"\"/\"\*\"/g"

renjith_nair
Legend

Try

eval my-new-field=replace(string-to-replace,"\*","")
Happy Splunking!
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...