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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...