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 

 

 

Labels (1)
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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...