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!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...