Dashboards & Visualizations

How to replace empty field with specific string ?

mah
Builder

hi, 

I have a search like this : 

|rest /services/data/indexes splunk_server=local count=0 | search disabled=0 title!=_blocksignature title!=_thefishbucket | rename title AS index | fields index
| lookup indexes.csv index OUTPUT account
| search index=*xxx*

The result is a table like that :

indexaccount
xxx-aaa 
xxx-bbbD
ccc-xxx 

 

I want to fill empty cell account with "D" account only for index containing "xxx" string.

I tried an eval :  | eval account=if(index=="*xxx*","D",account)  but it doesn't work. 

Can you help me ?

Thanks.

 

Tags (1)
0 Karma
1 Solution

493669
Super Champion

@mah Try below-

| eval account=if(match(index,"xxx"),"D",account)  

View solution in original post

Tags (1)

493669
Super Champion

@mah Try below-

| eval account=if(match(index,"xxx"),"D",account)  
Tags (1)
Get Updates on the Splunk Community!

Splunk App for Anomaly Detection End of Life Announcment

Q: What is happening to the Splunk App for Anomaly Detection?A: Splunk is officially announcing the ...

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...