<?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 search the delta between the Unix Time of each sequential web log grouped by ID? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273991#M82653</link>
    <description>&lt;P&gt;Aha, Streamstats! &lt;/P&gt;

&lt;P&gt;All these answers are utterly helpful, so I would like to choose them all, however I don't think I am able to do so. &lt;/P&gt;

&lt;P&gt;No particular response was better, so I've up-voted all of them.&lt;/P&gt;

&lt;P&gt;Thank you all for your assistance!&lt;/P&gt;</description>
    <pubDate>Fri, 27 May 2016 23:21:03 GMT</pubDate>
    <dc:creator>farismitri</dc:creator>
    <dc:date>2016-05-27T23:21:03Z</dc:date>
    <item>
      <title>How to search the delta between the Unix Time of each sequential web log grouped by ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273987#M82649</link>
      <description>&lt;P&gt;To put it as simply as possible: &lt;/P&gt;

&lt;P&gt;Imagine 8 log entries with only two fields per log, t = time &amp;amp; ID = Identifier&lt;/P&gt;

&lt;P&gt;Logs:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#1 t=1.0 ID=1
#2 t=2.0 ID=1
#3 t=3.0 ID=1
#4 t=4.0 ID=1
#5 t=1.0 ID=2
#6 t=1.5 ID=2
#7 t=2.0 ID=2
#8 t=2.5 ID=2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to extract a field based on the delta between the time stamps, and have it linked to the &lt;CODE&gt;ID&lt;/CODE&gt; succeeding each call. Lets call this field &lt;CODE&gt;D&lt;/CODE&gt; (= Delta)&lt;/P&gt;

&lt;P&gt;So ideally the associated stats (or whatever applicable Splunk search is right for this) would look like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;t=1.0 ID=1 D=0.0
t=2.0 ID=1 D=1.0
t=3.0 ID=1 D=1.0
t=4.0 ID=1 D=1.0
t=1.0 ID=2 D=0.0
t=1.5 ID=2 D=0.5
t=2.0 ID=2 D=0.5
t=2.5 ID=2 D=0.5
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The idea behind this is doing analysis on behavior of scripted vs human interactions in web logs based on delta's between calls from a single client identifier. And each &lt;CODE&gt;Delta&lt;/CODE&gt; only needs to be correlated back to the next sequential timestamp for each &lt;CODE&gt;ID&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Any input would be much appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 23:26:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273987#M82649</guid>
      <dc:creator>farismitri</dc:creator>
      <dc:date>2016-05-26T23:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the delta between the Unix Time of each sequential web log grouped by ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273988#M82650</link>
      <description>&lt;P&gt;See if this gets you going&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | streamstats window=1 current=f global=f latest(_time) as nexttime by id | eval d=tostring(nexttime-_time, "duration") | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 May 2016 00:37:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273988#M82650</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-05-27T00:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the delta between the Unix Time of each sequential web log grouped by ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273989#M82651</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | reverse | streamstats current=f last(t) AS tPrev BY ID | eval D = t - coalesce(tPrev, 0)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 May 2016 00:40:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273989#M82651</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-05-27T00:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the delta between the Unix Time of each sequential web log grouped by ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273990#M82652</link>
      <description>&lt;P&gt;You're going to be looking for the streamstats command &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/streamstats"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/streamstats&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;An example search for windows event logs would be something like the following: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wineventlog sourcetype="WinEventLog:Security"  EventCode=4624 | streamstats range(_time) as Duration by user window=2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where Duration would be the time in seconds between the previous and current event where the user in that event logged in. Good luck!&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 00:41:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273990#M82652</guid>
      <dc:creator>ryanoconnor</dc:creator>
      <dc:date>2016-05-27T00:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the delta between the Unix Time of each sequential web log grouped by ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273991#M82653</link>
      <description>&lt;P&gt;Aha, Streamstats! &lt;/P&gt;

&lt;P&gt;All these answers are utterly helpful, so I would like to choose them all, however I don't think I am able to do so. &lt;/P&gt;

&lt;P&gt;No particular response was better, so I've up-voted all of them.&lt;/P&gt;

&lt;P&gt;Thank you all for your assistance!&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 23:21:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273991#M82653</guid>
      <dc:creator>farismitri</dc:creator>
      <dc:date>2016-05-27T23:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the delta between the Unix Time of each sequential web log grouped by ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273992#M82654</link>
      <description>&lt;P&gt;One minor nit-pick: this solution shows the duration between an event and the &lt;EM&gt;NEXT&lt;/EM&gt; event, not the &lt;EM&gt;previous&lt;/EM&gt;.  To do what you literally said (which I think the OP was desiring), you will have to insert &lt;CODE&gt;|reverse&lt;/CODE&gt; before the &lt;CODE&gt;| streamstats&lt;/CODE&gt;.  Major ++ for the using both &lt;CODE&gt;range&lt;/CODE&gt; and &lt;CODE&gt;window&lt;/CODE&gt;!!!&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 23:30:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273992#M82654</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-05-27T23:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the delta between the Unix Time of each sequential web log grouped by ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273993#M82655</link>
      <description>&lt;P&gt;@Woodcock, OP here, I ended up using pieces of all responses (Specifically "|reverse") in order to achieve my desired results! &lt;/P&gt;

&lt;P&gt;Wanted to take a moment to appreciate how awesome the Splunk Answers community is. First question i've posted after 2 years using Splunk and I'm blown away at the helpfulness!&lt;/P&gt;

&lt;P&gt;Thanks again, all!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2016 02:23:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273993#M82655</guid>
      <dc:creator>farismitri</dc:creator>
      <dc:date>2016-06-01T02:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the delta between the Unix Time of each sequential web log grouped by ID?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273994#M82656</link>
      <description>&lt;P&gt;Glad you found the help you needed from one of the best communities around &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;Cheers!&lt;/P&gt;

&lt;P&gt;Patrick&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2016 20:20:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-delta-between-the-Unix-Time-of-each-sequential/m-p/273994#M82656</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2016-06-04T20:20:22Z</dc:date>
    </item>
  </channel>
</rss>

