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!

Why You Can't Miss .conf25: Unleashing the Power of Agentic AI with Splunk & Cisco

The Defining Technology Movement of Our Lifetime The advent of agentic AI is arguably the defining technology ...

Deep Dive into Federated Analytics: Unlocking the Full Power of Your Security Data

In today’s complex digital landscape, security teams face increasing pressure to protect sprawling data across ...

Your summer travels continue with new course releases

Summer in the Northern hemisphere is in full swing, and is often a time to travel and explore. If your summer ...