Dashboards & Visualizations

How to display last refreshed/updated time in dashboard?

koshyk
Super Champion

May be a quick question to UI experts out there.
My dashboard have auto-refresh enabled, but wanted to show the "last updated" (refreshed) time in another panel.
Is there an easy simpleXML function for this?

(I'm thinking of running a dummy search and putting the timestamp as last resort)

Cheers

0 Karma
1 Solution

somesoni2
Revered Legend

You can set a token to the current time when your panel search is completed. You can then use the token in other panel to display it. I think it can be done with something like this:-

<panel>
      <title></title>
     <table>
      <search>
        <query>index=_internal |  top sourcetype</query>
        <earliest>0</earliest>
        <latest>now</latest>
        <done>
          <eval token="lastUpdatedOn">strftime(now(),"%m/%d/%Y %H:%M:%S")</eval>
        </done>
      </search>
     ...other options
    </table>
    </panel>

Reference:

http://docs.splunk.com/Documentation/Splunk/6.4.1/Viz/PanelreferenceforSimplifiedXML#search

View solution in original post

somesoni2
Revered Legend

You can set a token to the current time when your panel search is completed. You can then use the token in other panel to display it. I think it can be done with something like this:-

<panel>
      <title></title>
     <table>
      <search>
        <query>index=_internal |  top sourcetype</query>
        <earliest>0</earliest>
        <latest>now</latest>
        <done>
          <eval token="lastUpdatedOn">strftime(now(),"%m/%d/%Y %H:%M:%S")</eval>
        </done>
      </search>
     ...other options
    </table>
    </panel>

Reference:

http://docs.splunk.com/Documentation/Splunk/6.4.1/Viz/PanelreferenceforSimplifiedXML#search

Taruchit
Contributor

Hi @somesoni2 

Thank you for sharing your inputs. I am able to get the date and time on the dashboard. 
in my scenario, the dashboard takes data from lookup table, which is being updated at runtime. 

 

0 Karma

koshyk
Super Champion

Cheers. It works

0 Karma

somesoni2
Revered Legend

What version of Splunk you're using?

0 Karma

koshyk
Super Champion

6.4.1 enterprise

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...