Splunk Search

Replace a string with other 2 strings

hashsplunk
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 .

role_seu_458137407337_prd-sso-data-science-752-2205-pl

role_seu_458137407337_prd-sso-data-science-752-2205-ds

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

scelikok
SplunkTrust
SplunkTrust

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 and "Accept as Solution" is appreciated.
0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...