<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Realtime clock of Splunk server time on dashboard? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102959#M26599</link>
    <description>&lt;P&gt;I take that back it was the foo NOT foo causing the 6 second interval plus a substantial delay when compared to my system clock.&lt;/P&gt;

&lt;P&gt;My answer still stands as the fastest updating version (with minimal delay) but does have the issue of not showing when users dont have access to _internal.&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2013 05:13:18 GMT</pubDate>
    <dc:creator>phoenixdigital</dc:creator>
    <dc:date>2013-10-17T05:13:18Z</dc:date>
    <item>
      <title>Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102951#M26591</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;A client has requested we give them a realtime clock on a dashboard showing the current &lt;STRONG&gt;server time&lt;/STRONG&gt;. I have seen many examples which show how to use a javascript clock on a dashboard but this is obviously the local users computer time.&lt;/P&gt;

&lt;P&gt;The only thing I can think of that comes close is this in a 30 second realtime window.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* | eval clock = strftime(time(), "%H:%M:%S") | sort 1 -_time | table clock
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a better way to show the server time?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2013 22:30:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102951#M26591</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2013-10-16T22:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102952#M26592</link>
      <description>&lt;P&gt;Also pretty bizarre, but you could run this search with any realtime timerange: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;foo NOT foo | stats count | eval clock = strftime(time(), "%H:%M:%S") | table clock&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;It would never match any events, but it would keep checking enough to keep advancing the clock time every few seconds... &lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 01:28:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102952#M26592</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-10-17T01:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102953#M26593</link>
      <description>&lt;P&gt;Well, first you don't want to start with index=*, because that has to do a massive search that hits the disk for the index, or else it might return zero results. Starting off with | stats count doesn't do that, and guarantees exactly one result, a single field with a value of zero. So with that:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count | eval clock=_time | fields - count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Will do it more cleanly. &lt;/P&gt;

&lt;P&gt;On the other hand, if you trust the client clock, you could just get the offset from the server time once at page load, then use that to display the browser time with that offset. This can let you keep the clock ticking without server queries. &lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 01:34:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102953#M26593</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2013-10-17T01:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102954#M26594</link>
      <description>&lt;P&gt;Thanks guys for the responses unfortunately Nick yours will only work if the "main" index gets updated frequently which is why I put index=* in there.&lt;/P&gt;

&lt;P&gt;Sadly just stats for a realtime search never updates&lt;BR /&gt;
| stats count | eval clock = strftime(time(), "%H:%M:%S") | table clock&lt;/P&gt;

&lt;P&gt;I have however used your ideas to come up with this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" | stats count | eval clock = strftime(time(), "%H:%M:%S") | table clock
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We can pretty much assume the _internal index would be updated the most frequently so it would be a good one to base the time from.&lt;/P&gt;

&lt;P&gt;I like the idea of using an offset too gkanapathy but will stick with this simple version unless they want it to change every second as opposed to every 3 seconds or so.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 03:38:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102954#M26594</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2013-10-17T03:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102955#M26595</link>
      <description>&lt;P&gt;Indeed just a &lt;CODE&gt;| stats count&lt;/CODE&gt; search wont update in a realtime timerange.  But that's what the &lt;CODE&gt;foo NOT foo&lt;/CODE&gt; is doing.  the job updates every cycle regardless of whether or not the main index is getting new data.  Splunk isn't smart enough to know the &lt;CODE&gt;foo NOT foo&lt;/CODE&gt; will never match any events so it keeps trying. The _internal is another way to go, but don't forget that not all users and roles can actually see internal, so their clocks will stop.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 04:48:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102955#M26595</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-10-17T04:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102956#M26596</link>
      <description>&lt;P&gt;Ahhhh thanks for an insight into how Splunk works on the inside. I was under the "assumption" that it only updated when data arrived.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 04:56:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102956#M26596</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2013-10-17T04:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102957#M26597</link>
      <description>&lt;P&gt;I don't really know either, but &lt;CODE&gt;foo NOT foo&lt;/CODE&gt; does seem to work reliably in this context, in that it sets up a streaming portion of the search without actually doing anything. In general the same trick comes in handy in odd places.  For instance if you ever need to launder result rows back into event rows, (for example so that EventsViewer can render them), you can do &lt;CODE&gt;foo NOT foo | append [some other search | stats count by username sessionid]&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 04:58:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102957#M26597</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-10-17T04:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102958#M26598</link>
      <description>&lt;P&gt;However without index=_internal (on a dashboard not in search module/dash) it appears to update every 6 seconds. Wheras with index=_internal it appears to update every 3 seconds.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:59:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102958#M26598</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2020-09-28T14:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102959#M26599</link>
      <description>&lt;P&gt;I take that back it was the foo NOT foo causing the 6 second interval plus a substantial delay when compared to my system clock.&lt;/P&gt;

&lt;P&gt;My answer still stands as the fastest updating version (with minimal delay) but does have the issue of not showing when users dont have access to _internal.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 05:13:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102959#M26599</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2013-10-17T05:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102960#M26600</link>
      <description>&lt;P&gt;Actually this is the fastest its not the internal index giving the speedup&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; * | stats count | eval clock = strftime(time(), "%H:%M:%S") | table clock
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Oct 2013 05:16:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102960#M26600</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2013-10-17T05:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102961#M26601</link>
      <description>&lt;P&gt;Interesting. They both refresh every 3 seconds for me, even though my system has no realtime events coming into index main - if I leave the count field in there it remains at 0 throughout.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 05:17:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102961#M26601</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2013-10-17T05:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102962#M26602</link>
      <description>&lt;P&gt;I feel like I am spamming now but this would probably be even less of a hit on the system as it doesnt need to "count"&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;* | head 1 | eval clock = strftime(time(), "%H:%M:%S") | table clock count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Oct 2013 05:40:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102962#M26602</guid>
      <dc:creator>phoenixdigital</dc:creator>
      <dc:date>2013-10-17T05:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102963#M26603</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| stats count as Now | eval Now = strftime(now(), "%+")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ans:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Sat Jul 26 12:23:22 UTC 2014
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Jul 2014 23:02:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102963#M26603</guid>
      <dc:creator>chimbudp</dc:creator>
      <dc:date>2014-07-25T23:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102964#M26604</link>
      <description>&lt;P&gt;| makeresults is your friend &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 09:05:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102964#M26604</guid>
      <dc:creator>ateixeira_splun</dc:creator>
      <dc:date>2016-01-07T09:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102965#M26605</link>
      <description>&lt;P&gt;If you just want the clock out of the date/time of makeresults, then&lt;BR /&gt;
|makeresults | eval Clock=strftime(_time,"%H:%M:%S") | table Clock&lt;/P&gt;

&lt;P&gt;it takes less time and uses less resources then&lt;BR /&gt;
index="_internal" | stats count | eval clock = strftime(time(), "%H:%M:%S") | table clock&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 19:10:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102965#M26605</guid>
      <dc:creator>ArthurGautesen</dc:creator>
      <dc:date>2016-01-07T19:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102966#M26606</link>
      <description>&lt;P&gt;give these queries my Splunk is out by 1 hour. How to I update the timezone of splunk? my Ubuntu server is in UTC time but my splunk seems to be in another timezone. &lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 23:16:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102966#M26606</guid>
      <dc:creator>chrisprangnell</dc:creator>
      <dc:date>2017-11-15T23:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Realtime clock of Splunk server time on dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102967#M26607</link>
      <description>&lt;P&gt;I have a 1 server install of splunk. &lt;/P&gt;

&lt;P&gt;My ubuntu server is in UTC, but splunk seems to be in another timezone, and is 1 hour out from my local timezone, how do we change this timezone?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 23:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Realtime-clock-of-Splunk-server-time-on-dashboard/m-p/102967#M26607</guid>
      <dc:creator>chrisprangnell</dc:creator>
      <dc:date>2017-11-15T23:18:06Z</dc:date>
    </item>
  </channel>
</rss>

