<?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 How to extract time interval between each near two events? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-interval-between-each-near-two-events/m-p/587782#M204704</link>
    <description>&lt;P&gt;hi, I'm finding how to calculate each time difference from near 2 events&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example,&lt;/P&gt;
&lt;P&gt;if my search output is&lt;/P&gt;
&lt;P&gt;f1&amp;nbsp; &amp;nbsp; datetime&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp;~~ 09:00&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; &amp;nbsp; ~~ 10:00&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; &amp;nbsp; ~~ 15:00&lt;/P&gt;
&lt;P&gt;B&amp;nbsp; &amp;nbsp; ~~ 06:00&lt;/P&gt;
&lt;P&gt;B&amp;nbsp; &amp;nbsp; ~~ 08:30&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want a table like&lt;/P&gt;
&lt;P&gt;A 1:00&lt;/P&gt;
&lt;P&gt;A 5:00&lt;/P&gt;
&lt;P&gt;B 2:30&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I prefer to print it without making big temporary output table(for look-up or etc) if I can&lt;/P&gt;
&lt;P&gt;can I get some ideas?&lt;/P&gt;</description>
    <pubDate>Tue, 08 Mar 2022 04:13:28 GMT</pubDate>
    <dc:creator>JSIrony</dc:creator>
    <dc:date>2022-03-08T04:13:28Z</dc:date>
    <item>
      <title>How to extract time interval between each near two events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-interval-between-each-near-two-events/m-p/587782#M204704</link>
      <description>&lt;P&gt;hi, I'm finding how to calculate each time difference from near 2 events&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;for example,&lt;/P&gt;
&lt;P&gt;if my search output is&lt;/P&gt;
&lt;P&gt;f1&amp;nbsp; &amp;nbsp; datetime&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; &amp;nbsp; &amp;nbsp;~~ 09:00&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; &amp;nbsp; ~~ 10:00&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; &amp;nbsp; ~~ 15:00&lt;/P&gt;
&lt;P&gt;B&amp;nbsp; &amp;nbsp; ~~ 06:00&lt;/P&gt;
&lt;P&gt;B&amp;nbsp; &amp;nbsp; ~~ 08:30&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want a table like&lt;/P&gt;
&lt;P&gt;A 1:00&lt;/P&gt;
&lt;P&gt;A 5:00&lt;/P&gt;
&lt;P&gt;B 2:30&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I prefer to print it without making big temporary output table(for look-up or etc) if I can&lt;/P&gt;
&lt;P&gt;can I get some ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 04:13:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-interval-between-each-near-two-events/m-p/587782#M204704</guid>
      <dc:creator>JSIrony</dc:creator>
      <dc:date>2022-03-08T04:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: how can I extract time interval between each near 2 events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-interval-between-each-near-two-events/m-p/587785#M204706</link>
      <description>&lt;P&gt;Are you looking for&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Delta#delta" target="_blank" rel="noopener"&gt;delta&lt;/A&gt;?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| delta _time as timedelta&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Mar 2022 03:17:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-interval-between-each-near-two-events/m-p/587785#M204706</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-03-07T03:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: how can I extract time interval between each near 2 events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-interval-between-each-near-two-events/m-p/587794#M204709</link>
      <description>&lt;P&gt;thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I considered about delta, but it can't be grouped by another field (like f1 in question i wrote)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now I'm trying using streamstats-range-window=2 with time sorted table like this&lt;/P&gt;&lt;P&gt;| streamstats window=2 range(_time) by f1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;are there other better solutions?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 04:27:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-interval-between-each-near-two-events/m-p/587794#M204709</guid>
      <dc:creator>JSIrony</dc:creator>
      <dc:date>2022-03-07T04:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: how can I extract time interval between each near 2 events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-interval-between-each-near-two-events/m-p/587803#M204714</link>
      <description>&lt;P&gt;If groupby is a requirement (not quite clear in OP), streamstats is the answer.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Mar 2022 07:26:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-interval-between-each-near-two-events/m-p/587803#M204714</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-03-07T07:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: how can I extract time interval between each near 2 events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-interval-between-each-near-two-events/m-p/587815#M204720</link>
      <description>&lt;P&gt;Assuming you have the times (_time) in epoch format&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats range(_time) as timediff window=2 global=f by f1
| where timediff&amp;gt;0
| eval timediff=tostring(timediff,"duration")&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Mar 2022 09:59:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-time-interval-between-each-near-two-events/m-p/587815#M204720</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-07T09:59:58Z</dc:date>
    </item>
  </channel>
</rss>

