Dashboards & Visualizations

Create a dashboard button to modify earliest parameter of a search

tgow
Splunk Employee
Splunk Employee

We've got a status panel on a custom dashboard with a single value that displays the count of a field containing an error code. The view is refreshed every minute, so a running total of the error code is displayed. That all works fine. What we would like to do is add a button, like a submit button, that when pressed would modify the earliest parameter of the search to use a current time, essentially resetting the count to zero. source=monitor.txt eventtype=nl_data_error earliest=$st$ | stats count AS errs

Right now my $st$ parameter is hardcoded to a start time, but I'd like some action (like pressing the button) to modify that parameter with a new time.

Is dynamically resetting the earliest value even possible, or is there maybe some other way to reset the count?

Tags (2)
0 Karma

sideview
SplunkTrust
SplunkTrust

If when the page loads, it's acceptable for the initial search to be submitted also with the earliest time set to the current time, then this will work:

* [ | stats count | eval earliest=now() | table earliest ] | stats count AS errs

The subsearch isn't really a search at all, but just a little trick to get an "earliest=1231421" searchterm out to the main search, such that the value will always be set to the current time when the search is dispatched.

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 ...