Dashboards & Visualizations

How to display dynamic date time range in Splunk dashboard panel?

aak2
New Member

Hi All,

I'm using splunk 6

In a dashboard panel im searching previous week's logs. I want my panel name with the time range dynamically.like this

Total failed attempts 10/08/2014 to 16/08/2014

Thanks in advance.

0 Karma

somesoni2
Revered Legend

Try this workaround (using a single value panel instead of chart title)

<form>
  <label>TimechartTick</label>
  <fieldset autoRun="true" submitButton="false">
    <input type="time" searchWhenChanged="true">
      <default>
        <earliestTime>-7d@w0</earliestTime>
        <latestTime>@w0</latestTime>
      </default>
    </input>
  </fieldset>
  <row grouping="2">
    <single>
      <searchString>|gentimes start=-1 
| eval earliest=if(NOT isnum("-$earliest$"), relative_time(now(),"$earliest$"),"$earliest$") | eval latest=if(NOT isnum("-$latest$"), relative_time(now(),"$latest$"),"$latest$") | convert ctime(*) | eval message="Total failed attempts ".earliest." to ".latest | table message</searchString>
      <earliestTime>$earliest$</earliestTime>
      <latestTime>$latest$</latestTime>     
    </single>  
    <chart>
      <searchString>index=_internal | stats count by sourcetype</searchString>
      <earliestTime>$earliest$</earliestTime>
      <latestTime>$latest$</latestTime>
      <option name="charting.chart">column</option>      
    </chart>
  </row>
</form>

mvaradarajam
Path Finder

HI somesoni2 ,

I am using timerangepicker i have requirement like this
i want display timeranges in chart panel ( i want noth earliest and latest times) cn u plz help me................timerange selection is time all real or any selction(datein range also)

plz help me

0 Karma

HattrickNZ
Motivator

i ried to paste this into a dashboard i have but nothing would display.

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

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

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...