Dashboards & Visualizations

"Snap-To" 1 min time selected using shared time range picker in dashboard.

jss
Loves-to-Learn

I have a single visualization and line chart dashbord panels (there are more panels as well) which are linked to shared time range picker. In my case data is loaded into splunk after every 1 minute. How can I configure 'latest' time of these panels to snap to 1 min if I select Last 15 mins (earliest=now) from presets in time range picker so that it doesn't display '0' in panels? 
On selecting last 15 minutes from presets in shared time range picker 0 is displayed in single value and line chart visualization  

 

 

index=index1 sourcetype=sourcetype_name
| timechart span=1min sum(call_rate)

 

 

 

Capture.PNGCapture1.PNG

Labels (4)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
index=index1 sourcetype=sourcetype_name earliest="@m-15m" latest="@m-1m"
| timechart span=1min sum(call_rate)
0 Karma

jss
Loves-to-Learn

Actually the query is linked to shared time picker for whole dashboard. The xml looks like following:

<row>
    <panel>
      <single>
        <title>Call Rate</title>
        <search>
          <query>index=index1 sourcetype=sourcetype_name
| timechart span=1min sum(call_rate)</query>
          <earliest>$field1.earliest$</earliest>
          <latest>$field1.latest$</latest>
          <refresh>5m</refresh>
          <refreshType>delay</refreshType>
        </search>
        <option name="refresh.display">progressbar</option>
        <option name="trellis.enabled">0</option>
        <option name="useColors">1</option>
      </single>
    </panel>
</row>

 

I want if I select any time from time range picker, 'latest' time should snap to beginning of the minute. How can I do it using tokens in 'earliest' and 'latest'?

P.S: field1 is token for Time input of dashboard

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Set a token in your timepicker change handler and use that instead

      <change>
        <eval token="tokTimeLatestStartOfMinute">relative_time(relative_time(now(),'latest')-1,"@m")</eval>
      </change>

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...