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!

Splunk Certification Support Alert | Pearson VUE Outage

Splunk Certification holders and candidates!  Please be advised of an upcoming system maintenance period for ...

Enterprise Security Content Update (ESCU) | New Releases

In September, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...