Dashboards & Visualizations

Create a dashboard button to modify earliest parameter of a search

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


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!

Enterprise Security Content Update (ESCU) | New Releases

In the last month, the Splunk Threat Research Team (STRT) has had 2 releases of new security content via the ...

Announcing the 1st Round Champion’s Tribute Winners of the Great Resilience Quest

We are happy to announce the 20 lucky questers who are selected to be the first round of Champion's Tribute ...

We’ve Got Education Validation!

Are you feeling it? All the career-boosting benefits of up-skilling with Splunk? It’s not just a feeling, it's ...