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!

September Community Champions: A Shoutout to Our Contributors!

As we close the books on another fantastic month, we want to take a moment to celebrate the people who are the ...

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...