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!

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

May 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...