Dashboards & Visualizations

When I specify the time range in my dashboard panel, why does it display data for "all time"?

jaisudhan
Engager

Dashboard panel input time range is not getting reflected when i specify the specific time range, it is giving me the data for all time.

I have created a dashboard to monitor the logs from directory files and when i specify the time range to take the metrics for specified test time then the dash panel is not getting refreshed and giving all time metrics by pulling the data from all log files resides in the directory files

1 Solution

GregZillgitt
Path Finder

The problem is that your time-picker isn't wired up to your panel - the "earliest" and "latest" tags in the panel need to use the token produced by the time picker.

Here's an example of that:

<form>
  <label>HTTP Listener Events</label>
  <fieldset submitButton="false">
    <input type="time" token="field1">
      <label></label>
      <default>
        <earliest>0</earliest>
        <latest></latest>
      </default>
    </input>
  </fieldset>
  <row>
    <panel>
      <event>
        <search>
          <query>index=_internal sourcetype=splunkd HttpListener | dedup message</query>
          <earliest>0</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">50</option>
        <option name="list.drilldown">full</option>
        <option name="list.wrap">1</option>
        <option name="maxLines">5</option>
        <option name="raw.drilldown">full</option>
        <option name="rowNumbers">0</option>
        <option name="table.drilldown">all</option>
        <option name="table.sortDirection">asc</option>
        <option name="table.wrap">1</option>
        <option name="type">list</option>
      </event>
    </panel>
  </row>
</form>

Note the and tags in the panel. You probably have something similar to that. To fix it you can edit the xml directly, or use the gui:

You should end up with something like this:

<form>
  <label>HTTP Listener Events</label>
  <fieldset submitButton="false">
    <input type="time" token="field1">
      <label></label>
      <default>
        <earliest>0</earliest>
        <latest></latest>
      </default>
    </input>
  </fieldset>
  <row>
    <panel>
      <event>
        <search>
          <query>index=_internal sourcetype=splunkd HttpListener | dedup message</query>
          <earliest>$field1.earliest$</earliest>
          <latest>$field1.latest$</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">50</option>
        <option name="list.drilldown">full</option>
        <option name="list.wrap">1</option>
        <option name="maxLines">5</option>
        <option name="raw.drilldown">full</option>
        <option name="rowNumbers">0</option>
        <option name="table.drilldown">all</option>
        <option name="table.sortDirection">asc</option>
        <option name="table.wrap">1</option>
        <option name="type">list</option>
      </event>
    </panel>
  </row>
</form>

View solution in original post

GregZillgitt
Path Finder

The problem is that your time-picker isn't wired up to your panel - the "earliest" and "latest" tags in the panel need to use the token produced by the time picker.

Here's an example of that:

<form>
  <label>HTTP Listener Events</label>
  <fieldset submitButton="false">
    <input type="time" token="field1">
      <label></label>
      <default>
        <earliest>0</earliest>
        <latest></latest>
      </default>
    </input>
  </fieldset>
  <row>
    <panel>
      <event>
        <search>
          <query>index=_internal sourcetype=splunkd HttpListener | dedup message</query>
          <earliest>0</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">50</option>
        <option name="list.drilldown">full</option>
        <option name="list.wrap">1</option>
        <option name="maxLines">5</option>
        <option name="raw.drilldown">full</option>
        <option name="rowNumbers">0</option>
        <option name="table.drilldown">all</option>
        <option name="table.sortDirection">asc</option>
        <option name="table.wrap">1</option>
        <option name="type">list</option>
      </event>
    </panel>
  </row>
</form>

Note the and tags in the panel. You probably have something similar to that. To fix it you can edit the xml directly, or use the gui:

You should end up with something like this:

<form>
  <label>HTTP Listener Events</label>
  <fieldset submitButton="false">
    <input type="time" token="field1">
      <label></label>
      <default>
        <earliest>0</earliest>
        <latest></latest>
      </default>
    </input>
  </fieldset>
  <row>
    <panel>
      <event>
        <search>
          <query>index=_internal sourcetype=splunkd HttpListener | dedup message</query>
          <earliest>$field1.earliest$</earliest>
          <latest>$field1.latest$</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">50</option>
        <option name="list.drilldown">full</option>
        <option name="list.wrap">1</option>
        <option name="maxLines">5</option>
        <option name="raw.drilldown">full</option>
        <option name="rowNumbers">0</option>
        <option name="table.drilldown">all</option>
        <option name="table.sortDirection">asc</option>
        <option name="table.wrap">1</option>
        <option name="type">list</option>
      </event>
    </panel>
  </row>
</form>

jaisudhan
Engager

Many thanks Greg. i was hanging around for many hours to resolve this. it is working now as per the suggestion. thanks much

0 Karma

rjthibod
Champion

You need to share your XML for the community to accurately help you.

0 Karma

rjthibod
Champion

The likely culprit is a disconnect on how you define the timpicker input token versus how that token is or is not referenced in the search. Your specific XML will help pinpoint this.

0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...