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!

OpenTelemetry for Legacy Apps? Yes, You Can!

This article is a follow-up to my previous article posted on the OpenTelemetry Blog, "Your Critical Legacy App ...

UCC Framework: Discover Developer Toolkit for Building Technology Add-ons

The Next-Gen Toolkit for Splunk Technology Add-on Development The Universal Configuration Console (UCC) ...

.conf25 Community Recap

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