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!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...