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,"\*","")
---
What goes around comes around. If it helps, hit it with Karma 🙂
Get Updates on the Splunk Community!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...