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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...