<?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 time difference between two fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/time-difference-between-two-fields/m-p/678484#M232018</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have two fields, where time zone seems to be different.. please could you help me to get difference ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;itime=&amp;nbsp;&lt;SPAN&gt;2024-02-22 20:56:02,185&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;stime=&lt;SPAN&gt;2024-02-23T01:56:02Z&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I tried the below but it always gives around 5 hrs delay..&lt;/P&gt;
&lt;P&gt;SPL:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval itime=strptime(Initial_Time,"%Y-%m-%d %H:%M:%S,%3N")
| eval stime=strptime(s_time,"%Y-%m-%dT%H:%M:%S")
| eval difference = abs(itime - stime)
| eval time_difference=tostring(difference, "duration")&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 23 Feb 2024 15:08:44 GMT</pubDate>
    <dc:creator>selvam_sekar</dc:creator>
    <dc:date>2024-02-23T15:08:44Z</dc:date>
    <item>
      <title>time difference between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-difference-between-two-fields/m-p/678484#M232018</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have two fields, where time zone seems to be different.. please could you help me to get difference ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;itime=&amp;nbsp;&lt;SPAN&gt;2024-02-22 20:56:02,185&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;stime=&lt;SPAN&gt;2024-02-23T01:56:02Z&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I tried the below but it always gives around 5 hrs delay..&lt;/P&gt;
&lt;P&gt;SPL:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eval itime=strptime(Initial_Time,"%Y-%m-%d %H:%M:%S,%3N")
| eval stime=strptime(s_time,"%Y-%m-%dT%H:%M:%S")
| eval difference = abs(itime - stime)
| eval time_difference=tostring(difference, "duration")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 23 Feb 2024 15:08:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-difference-between-two-fields/m-p/678484#M232018</guid>
      <dc:creator>selvam_sekar</dc:creator>
      <dc:date>2024-02-23T15:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: time difference between two fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/time-difference-between-two-fields/m-p/678487#M232019</link>
      <description>&lt;P&gt;Have you tried incorporating the time zone in the &lt;FONT face="courier new,courier"&gt;strptime&lt;/FONT&gt; call?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval stime=strptime(s_time,"%Y-%m-%dT%H:%M:%S%Z")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 13:57:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/time-difference-between-two-fields/m-p/678487#M232019</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-02-23T13:57:06Z</dc:date>
    </item>
  </channel>
</rss>

