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!

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2025 SplunkTrust is officially open! If you ...

Splunk Answers Content Calendar, June Edition II

Get ready to dive into Splunk Dashboard panels this week! We'll be tackling common questions around ...

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...