Dashboards & Visualizations

Dashboard not showing date correctly

balash1979
Path Finder

I am using the following code in my dashboard

 <search>
 <query>| makeresults</query>
 <earliest>$field1.earliest$</earliest>
 <latest>$field1.latest$</latest>
 <done>
  <eval token="tokTime">$job.earliestTime$</eval>
  <eval token="tokEarliestTime">strftime(strptime($job.earliestTime$,"%Y/%m/%dT%H:%M:%S %p"),"%m/%d/%y %I:%M:%S %p") 
 </eval>
  <eval token="tokLatestTime">strftime(strptime($job.latestTime$,"%Y/%m/%dT%H:%M:%S %p"),"%m/%d/%y %I:%M:%S %p")</eval>
</done>
</search>

In my panel, i use this

<title>from $tokEarliestTime$ to $tokLatestTime$</title>

When I save my dashboard it shows up as
from invalid date to invalid date

Do I need to change any personal settings in splunk to get this working ?

Tags (1)
0 Karma

vnravikumar
Champion

Hi

Try this

<form>
  <label>date</label>
  <fieldset submitButton="false">
    <input type="time" token="field1">
      <label></label>
      <default>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </default>
    </input>
  </fieldset>
  <row>
    <panel>
      <title>from $tokEarliest$ to $tokLatest$</title>
      <table>
        <search>
          <query>| makeresults</query>
          <earliest>$field1.earliest$</earliest>
          <latest>$field1.latest$</latest>
          <done>
            <eval token="tokTime">$job.earliestTime$</eval>
            <eval token="tokEarliest">strftime(strptime($job.earliestTime$,"%Y-%m-%dT%H:%M:%S.%3N%z"),"%m/%d/%y %I:%M:%S %p")</eval>
            <eval token="tokLatest">strftime(strptime($job.latestTime$,"%Y-%m-%dT%H:%M:%S.%3N%z"),"%m/%d/%y %I:%M:%S %p")</eval>
          </done>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</form>
0 Karma

woodcock
Esteemed Legend

Try this:

<search>
 <query>| makeresults</query>
 <earliest>$field1.earliest$</earliest>
 <latest>$field1.latest$</latest>
 <done>
  <eval token="tokTime">$job.earliestTime$</eval>
  <eval token="tokEarliestTime">strftime($job.earliestTime$,"%Y/%m/%dT%H:%M:%S %p")</eval>
  <eval token="tokLatestTime">strftime($job.latestTime$,"%Y/%m/%dT%H:%M:%S %p")</eval>
</done>

And then this:

<title>from $tokEarliestTime$ to $tokLatestTime$</title>
0 Karma

balash1979
Path Finder

Same issue as before. it says invalid date in the dashboard.
Sounds like some server side settings that need to change ?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...