Splunk Search

Help for diisplay a message in a single panel following a token value

jip31
Motivator

HI

I use the code below and I would like that if the host I fill in my drilldown doenst exists J have the message "No Battery results" in my single panel

Could you help me please??

 

 

| inputlookup tablet_host.csv 
| lookup Pan.csv "Hostname00" as host OUTPUT HealthState00 
| search host=$tok_filterhost$ 
| stats values(HealthState00) as HS 

 

 

Tags (1)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @jip31,

try something like this:

| inputlookup tablet_host.csv 
| lookup Pan.csv "Hostname00" as host OUTPUT HealthState00 
| search host=$tok_filterhost$ 
| stats values(HealthState00) as HS 
| append [ | makeresults | eval HealthState00="No Battery result" | fields HealthState00 ]

Ciao.

Giuseppe

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @jip31,

I was wrong, please check this:

| inputlookup tablet_host.csv 
| lookup Pan.csv "Hostname00" as host OUTPUT HealthState00 
| search host=$tok_filterhost$ 
| stats values(HealthState00) as HS 
| append [ | makeresults | eval HS="No Battery result" | fields HS ]
| table HS

Ciao.

Giuseppe

0 Karma

jip31
Motivator

Hi

it doesnt works

If the token value is not good, I have 0% instead "No Battery result"

0 Karma
Get Updates on the Splunk Community!

.conf25 Community Recap

Hello Splunkers, And just like that, .conf25 is in the books! What an incredible few days — full of learning, ...

Splunk App Developers | .conf25 Recap & What’s Next

If you stopped by the Builder Bar at .conf25 this year, thank you! The retro tech beer garden vibes were ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...