<?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: How to find a difference between two times which are off by two different formats and set an alert if the difference is more than 10mins? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-difference-between-two-times-which-are-off-by-two/m-p/432474#M123585</link>
    <description>&lt;P&gt;Please explain how can you strip the time out of 2 epoch times together. Also how can you compare an epoch time result against a regular number ? &lt;/P&gt;</description>
    <pubDate>Wed, 24 Oct 2018 15:50:43 GMT</pubDate>
    <dc:creator>rsokolova</dc:creator>
    <dc:date>2018-10-24T15:50:43Z</dc:date>
    <item>
      <title>How to find a difference between two times which are off by two different formats and set an alert if the difference is more than 10mins?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-difference-between-two-times-which-are-off-by-two/m-p/432471#M123582</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a query  which returns two columns Time1 which is _time and one more column Time 2 which is user calculated time available in the event as below,&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5665i2593B2DF9375901B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Query used &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=data |eval GetdateTime = date + " " + gettime  | timechart span=5m last(GetdateTime) as Time2 by server
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Query returns the last date logged in event by server. I have to identify difference between those two time fields which is _time &amp;amp; Time2. How do i find the difference since the format of the fields are different for hours section. _time uses : as separator where in the field available in the column is using . as separator. How do i replace it and then convert it to epochtime in order to find the difference ?&lt;/P&gt;

&lt;P&gt;I need to define an alert in real time to check if there is a difference in field is more than 10 mins &lt;BR /&gt;
Please let me know.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 11:31:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-difference-between-two-times-which-are-off-by-two/m-p/432471#M123582</guid>
      <dc:creator>sangs8788</dc:creator>
      <dc:date>2018-08-28T11:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a difference between two times which are off by two different formats and set an alert if the difference is more than 10mins?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-difference-between-two-times-which-are-off-by-two/m-p/432472#M123583</link>
      <description>&lt;P&gt;There is no need to convert _time as it is already in epoch form (it's automatically converted to text when displayed).  Use the &lt;CODE&gt;strptime&lt;/CODE&gt; function to convert time2 to an epoch then you can subtract the two times to find their difference.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=data |eval GetdateTime = date + " " + gettime | eval Timediff=strptime(GetdateTime, "%Y-%m-%d %H.%M.%S") | where Timediff&amp;gt;600 | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Aug 2018 12:13:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-difference-between-two-times-which-are-off-by-two/m-p/432472#M123583</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-08-28T12:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a difference between two times which are off by two different formats and set an alert if the difference is more than 10mins?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-difference-between-two-times-which-are-off-by-two/m-p/432473#M123584</link>
      <description>&lt;P&gt;Hi @sangs8788. Did the answer below solve your question? If yes, please click “Accept” directly below the answer to resolve the post. If not, please comment with more information if you are still having issues. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Aug 2018 19:35:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-difference-between-two-times-which-are-off-by-two/m-p/432473#M123584</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2018-08-28T19:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to find a difference between two times which are off by two different formats and set an alert if the difference is more than 10mins?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-difference-between-two-times-which-are-off-by-two/m-p/432474#M123585</link>
      <description>&lt;P&gt;Please explain how can you strip the time out of 2 epoch times together. Also how can you compare an epoch time result against a regular number ? &lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 15:50:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-a-difference-between-two-times-which-are-off-by-two/m-p/432474#M123585</guid>
      <dc:creator>rsokolova</dc:creator>
      <dc:date>2018-10-24T15:50:43Z</dc:date>
    </item>
  </channel>
</rss>

