Splunk Search

Replace a string with other 2 strings

Loves-to-Learn Lots

Hi ,

I need to replace the string in a field value role_seu_458137407337_prd-sso-data-science-752-2205-compute-role"     -- >  compute-role should be replaced as below 2 other field values .



I have tried replace command compute-role WITH pl IN ad. It didnt work

What would be the solution for this .Please help 

Labels (1)
0 Karma


Hi @hashsplunk,

Below should work;

| eval ad=replace(ad,"compute-role","pl")


If this reply helps you, an upvote is appreciated.

If this reply helps you an upvote is appreciated.
0 Karma
Get Updates on the Splunk Community!

Dashboard Studio Challenge - Learn New Tricks, Showcase Your Skills, and Win Prizes!

Reimagine what you can do with your dashboards. Dashboard Studio is Splunk’s newest dashboard builder to ...

Introducing Edge Processor: Next Gen Data Transformation

We get it - not only can it take a lot of time, money and resources to get data into Splunk, but it also takes ...

Take the 2021 Splunk Career Survey for $50 in Amazon Cash

Help us learn about how Splunk has impacted your career by taking the 2021 Splunk Career Survey. Last year’s ...