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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...