<?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 the difference or delta in the two time fields for the same record? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/641789#M109433</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232940"&gt;@Souletting&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Here, in the following search, I am taking an example by makeresult command, for verifying the above search,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval rec_time="05/Feb/2023:03:12:03" 
| eval rem_time="05/Feb/2023:03:13:03" 
| eval Diff_in_Time=strptime(rem_time,"%d/%b/%Y:%H:%M:%S") - strptime(rec_time,"%d/%b/%Y:%H:%M:%S")
| eventstats sum(Diff_in_Time) as TotalDiff_in_Time 
| table rec_time rem_time Diff_in_Time TotalDiff_in_Time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output of the above search is as follows,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-04-28 233342.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25142i1408F2BAEB850917/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-04-28 233342.png" alt="Screenshot 2023-04-28 233342.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So, the search seems to be working fine, the issue seems to be in the time-format used in your search.&lt;/P&gt;&lt;P&gt;Kindly upvote if found useful.&lt;/P&gt;&lt;P&gt;Happy Splunking!&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2023 18:06:12 GMT</pubDate>
    <dc:creator>seemanshu</dc:creator>
    <dc:date>2023-04-28T18:06:12Z</dc:date>
    <item>
      <title>How to find the difference or delta in the two time fields for the same record?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/641765#M109426</link>
      <description>&lt;P&gt;I am trying to find a way to produce a column in a table to show the difference between the recieved_time and the remediation_time. Currently the Diff_in_Time field and TotalDiff_in_Time fields return empty. Any&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=someapplication sourcetype=some_log subject="*" "folder_locations{}"="*" from_address="*" remediation_timestamp="*" received_time="*" recipient_address="*" to_addresses="*"
| eval rectime=received_time
| eval remtime=remediation_timestamp
| eval Diff_in_Time=strptime(rectime, "%Y-%m-%d %H:%M:%S.%3N")-strptime(remtime, "%Y-%m-%d %H:%M:%S.%3N")
| eventstats sum(Diff_in_Time) as TotalDiff_in_Time
| table rectime remtime Diff_in_Time TotalDiff_in_Time&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 28 Apr 2023 16:03:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/641765#M109426</guid>
      <dc:creator>Souletting</dc:creator>
      <dc:date>2023-04-28T16:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the difference or delta in the two time fields for the same record?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/641784#M109431</link>
      <description>&lt;P&gt;That query looks right.&amp;nbsp; Can you share some sample events so we can verify the SPL is correct for the data?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 17:22:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/641784#M109431</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-04-28T17:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the difference or delta in the two time fields for the same record?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/641789#M109433</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232940"&gt;@Souletting&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Here, in the following search, I am taking an example by makeresult command, for verifying the above search,&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval rec_time="05/Feb/2023:03:12:03" 
| eval rem_time="05/Feb/2023:03:13:03" 
| eval Diff_in_Time=strptime(rem_time,"%d/%b/%Y:%H:%M:%S") - strptime(rec_time,"%d/%b/%Y:%H:%M:%S")
| eventstats sum(Diff_in_Time) as TotalDiff_in_Time 
| table rec_time rem_time Diff_in_Time TotalDiff_in_Time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The output of the above search is as follows,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-04-28 233342.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25142i1408F2BAEB850917/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-04-28 233342.png" alt="Screenshot 2023-04-28 233342.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So, the search seems to be working fine, the issue seems to be in the time-format used in your search.&lt;/P&gt;&lt;P&gt;Kindly upvote if found useful.&lt;/P&gt;&lt;P&gt;Happy Splunking!&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 18:06:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/641789#M109433</guid>
      <dc:creator>seemanshu</dc:creator>
      <dc:date>2023-04-28T18:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the difference or delta in the two time fields for the same record?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/642678#M109548</link>
      <description>&lt;P&gt;What you say makes sense but the rec_time and rem_time aren't static results. They will be different for each row. Is there a variable that can be used to pull those in and see the difference of time in each row.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 14:23:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/642678#M109548</guid>
      <dc:creator>Souletting</dc:creator>
      <dc:date>2023-05-09T14:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the difference or delta in the two time fields for the same record?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/642680#M109549</link>
      <description>&lt;P&gt;This is a sample of what I am looking at. I would like to have a column to show the difference in time between the received time and remediatated time. When I try to use the syntax above I only get a blank column.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-05-09 at 10.25.21 AM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/25291i4D9BEAE898968678/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-05-09 at 10.25.21 AM.png" alt="Screenshot 2023-05-09 at 10.25.21 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 14:29:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/642680#M109549</guid>
      <dc:creator>Souletting</dc:creator>
      <dc:date>2023-05-09T14:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the difference or delta in the two time fields for the same record?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/642686#M109551</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232940"&gt;@Souletting&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;The real data is suppose to be different with new rows, but here just to check the search, we have used the example of sample values for&amp;nbsp;&lt;SPAN&gt;rec_time and rem_time.&lt;BR /&gt;Also, this helps in verifying that if it works for the sample format of data, then it will work for the real data as well.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this explains!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 14:35:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/642686#M109551</guid>
      <dc:creator>seemanshu</dc:creator>
      <dc:date>2023-05-09T14:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the difference or delta in the two time fields for the same record?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/642688#M109552</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232940"&gt;@Souletting&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thanks for sharing the sample data format.&lt;BR /&gt;Please use the following search, as per the shared data format,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=someapplication sourcetype=some_log subject="*" "folder_locations{}"="*" from_address="*" remediation_timestamp="*" received_time="*" recipient_address="*" to_addresses="*"
| eval rectime=received_time
| eval remtime=remediation_timestamp
| eval Diff_in_Time=strptime(remtime,"%Y-%m-%d %H:%M:%S") - strptime(rectime,"%Y-%m-%d %H:%M:%S")
| eventstats sum(Diff_in_Time) as TotalDiff_in_Time
| table rectime remtime Diff_in_Time TotalDiff_in_Time&lt;/LI-CODE&gt;&lt;P&gt;Kindly support the answer, if found helpful.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 14:42:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/642688#M109552</guid>
      <dc:creator>seemanshu</dc:creator>
      <dc:date>2023-05-09T14:42:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the difference or delta in the two time fields for the same record?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/642711#M109555</link>
      <description>&lt;P&gt;Thank you that worked.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 17:16:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-find-the-difference-or-delta-in-the-two-time-fields-for/m-p/642711#M109555</guid>
      <dc:creator>Souletting</dc:creator>
      <dc:date>2023-05-09T17:16:24Z</dc:date>
    </item>
  </channel>
</rss>

