Splunk Search

Search query on page load and after selecting particular host?

geetanjali
Path Finder

Hello,

I have following query. $HostSelectBoxValue$ is drop down field name. I have to run this query on page load and also after selecting particular host. The default host is 'any' and value is '*'.

I want to show all hosts on page load and after selecting particular host, graph should show particular host's data graph.
Query is giving some problem.

index="power" sourcetype="power_usage" | eval host=if(HostSelectBoxValue=='$HostSelectBoxValue$','$HostSelectBoxValue$','*') | timechart max(Power_consumption) by host | sort 10 host

Tags (1)
0 Karma

Takajian
Builder

I think you can use search selector module in advanced view.

http://www.splunk.com/base/Documentation/4.2.1/Developer/HowToUseListers

Also, you can define multiple host in static select.

http://www.splunk.com/base/Documentation/latest/Developer/LookupsAndViews

I recommend App 'UI example" and ' 'side view'. These contains good example views. Please refer to them.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...