Splunk Enterprise

How to display customized text in table?

mahesh27
Communicator

Hi All,
My query:
index=abt_htt_app host=thyfg OR host=jhbjj OR host=nmm sourcetype=app:abt:logs |stats count as Transactions |where Transaction>10
|appendcols
[ index=tbt_htt_app host=juhy OR host=kuthf OR host=nmm sourcetype=app:abt:logs |stats count as Sucess |where Sucess>5]
|appendcols
[ index=ccc_htt_app sourcetype=app:abt:even |stats count as failed |where falied>10]
|appendcols
[ index=tbt_htt_app host=juhy OR host=kuthf OR host=nmm sourcetype=app:clt:logs |stats count as error |where error>45]

Output:

Transactions Sucess failed error
12 5 4 10


but when the count condition does not met all the fileds wont get dsiplayed and when i get only transactions count in table
Here i want to add a customized text like "No action required" under the table as shown below:
how can i do this??
Output:

Transactions
12

"No action required"

Labels (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

You can always add

| fillnull Transactions Sucess failed error

to the end of your search which will always make those fields 0 if they do not exist - but only if at least ONE of them exists, but what do you want to fill those values with.

You could also do this, which would very likely be faster

(index=abt_htt_app host=thyfg OR host=jhbjj OR host=nmm sourcetype=app:abt:logs) OR 
(index=tbt_htt_app host=juhy OR host=kuthf OR host=nmm sourcetype=app:abt:logs) OR 
(index=ccc_htt_app sourcetype=app:abt:even) OR
(tbt_htt_app host=juhy OR host=kuthf OR host=nmm sourcetype=app:clt:logs)
| stats count(eval(index="abt_htt_app")) as Transaction count(eval(index="tbt_htt_app")) as Sucess count(eval(index="ccc_htt_app")) as failed count(eval(index="host")) as error
| eval Transaction=if(Transaction>10, Transaction, 0)
| eval Sucess=if(Sucess>5, Sucess, 0)
| eval failed=if(failed>10, failed, 0)
| eval error=if(error>45, error, 0)
0 Karma
Get Updates on the Splunk Community!

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

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

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...

4 Ways the Splunk Community Helps You Prepare for .conf25

.conf25 is right around the corner, and whether you’re a first-time attendee or a seasoned Splunker, the ...