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)
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...