Dashboards & Visualizations

How to display the page last updated time in the dashboard?

anjibabu
New Member

Hi Friends,

could you pls advise, how to add the dashboard Last updated time on the dashboard page to understand when the page refreshed.

Labels (1)
Tags (1)
0 Karma
1 Solution

manjunathmeti
SplunkTrust
SplunkTrust

hi @anjibabu,

Try this.

<dashboard>
  <init>
    <eval token="curTime">strftime(now(), "%d-%m-%Y %H:%M:%S")</eval>
  </init>
  <label>Title</label>
  <row>
    <panel>
      <html>
          <h3>Dashboard refreshed at: $curTime$.</h3>
      </html>
    </panel>
  </row>
  <row>
    <panel>
      <table>
        <title>_internal index</title>
        <search>
          <query>index=_internal earliest=-15m | stats count by sourcetype, source, host</query>
          <earliest>-5m</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</dashboard>

View solution in original post

Taruchit
Contributor

Hi All, 
Thank you for sharing the details of displaying the last update/refreshed date-time. 

In my case, it takes my local system's timezone. I changed the timezone in Splunk from default to EST, but it still takes and displays time as per local timezone. Can you please share a way to display the date time for a specific timezone irrespective of the local timezone on which the dashboard is being accessed? 

Thank you

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Hi @Taruchit 

The thread you're replying to is a really old one. Also, your question is not really directly connected with the main subject of the thread.

Please start a new thread with your question. If you already tried something from this thread, you can always drop a link to it with explanation.

0 Karma

Taruchit
Contributor

Thank you for your response. I have created a new thread to seek help on the problem: -

https://community.splunk.com/t5/Dashboards-Visualizations/How-to-display-last-update-time-for-a-spec... 

0 Karma

anjibabu
New Member

Hi Friends,

could you please share your inputs here.

<eval token="curTime">strftime(now(), "%H:%M")</eval>

SRE Dashboard Clone_4/2/20202

<earliest>-1h@h</earliest>
<latest>now</latest>
<refresh>5m</refresh>
<refreshType>delay</refreshType>


<earliest>-1h@h</earliest>
<latest>now</latest>
<refresh>5m</refresh>
<refreshType>delay</refreshType>


<panel>
  <html>
     <body style="background-color:powderblue;">
     <div style="float:right;">
       <h3>Last Updated: $curTime$</h3>
        </div>
        </body>
   </html>
</panel>


<panel>
  <html>
    <body style="background-color:powderblue;">
     <div style="float:left;">
      <h3>
        <font size="15" color="DodgerBlue">Dom</font>
        </h3>
        </div>
        </body>
       </html>
</panel>
0 Karma

anjibabu
New Member

Thank you so much for your prompt response @manjunathmeti.

I have updated my dashboard with the above code, my dashboard refresh on every 5 mins, the new date panel is not refreshing and showing latest time, but when i refresh the browser or close\open the dashboard then only it is showing the latest time, could you pls advise.

below is my code.

<eval token="curTime">strftime(now(), "%d-%m-%Y %H:%M")</eval>

SRE Dashboard Clone_4/2/20202

<earliest>-1h@h</earliest>
<latest>now</latest>
<refresh>5m</refresh>
<refreshType>delay</refreshType>


<earliest>-1h@h</earliest>
<latest>now</latest>
<refresh>5m</refresh>
<refreshType>delay</refreshType>

<row>
<panel>
  <html>
     <body style="background-color:powderblue;">
     <div style="float:right;">
       <h3>Last Updated: $curTime$</h3>
        </div>
        </body>
   </html>
</panel>


<panel>
  <html>
    <body style="background-color:powderblue;">
     <div style="float:left;">
      <h3>
        <font size="15" color="DodgerBlue">Domino</font>
        </h3>
        </div>
        </body>
       </html>
</panel>


<panel>
  <html> 
     <div style="float:left;">
      <h3>
        <font size="5" color="LightSkyBlue">Extractors</font>
      </h3>
      </div>
     </html>
</panel>
0 Karma

manjunathmeti
SplunkTrust
SplunkTrust

hi @anjibabu,

Try this.

<dashboard>
  <init>
    <eval token="curTime">strftime(now(), "%d-%m-%Y %H:%M:%S")</eval>
  </init>
  <label>Title</label>
  <row>
    <panel>
      <html>
          <h3>Dashboard refreshed at: $curTime$.</h3>
      </html>
    </panel>
  </row>
  <row>
    <panel>
      <table>
        <title>_internal index</title>
        <search>
          <query>index=_internal earliest=-15m | stats count by sourcetype, source, host</query>
          <earliest>-5m</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
</dashboard>
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...