<?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: Total Duration of a User from one point to Another in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589640#M205303</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;why do we have a condition like&amp;nbsp;&lt;BR /&gt;| where jeCount = 1&lt;BR /&gt;&lt;BR /&gt;is it only for when url/E is just once for each transaction&lt;/P&gt;</description>
    <pubDate>Fri, 18 Mar 2022 08:47:30 GMT</pubDate>
    <dc:creator>bijodev1</dc:creator>
    <dc:date>2022-03-18T08:47:30Z</dc:date>
    <item>
      <title>Total Duration of a User from one point to Another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589616#M205295</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below table is for one User, like wise I have to pull the details for many users - who visited multiple url on different timestamp, I am trying to calculate the total duration between each url/E to url/J.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what I am trying to achieve is whenever the user is visiting url/E and traversing till url/J - calculate the total duration. I trying using transaction command but it only calculates the last event of url/E and url/J&lt;/P&gt;&lt;P&gt;USER_ID.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TIMESTAMP.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL&lt;/P&gt;&lt;TABLE width="364px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="145.117px" height="40px"&gt;CD_125&lt;/TD&gt;&lt;TD width="160.359px" height="40px"&gt;05:30:36&lt;/TD&gt;&lt;TD width="57.5234px" height="40px"&gt;&lt;P&gt;URL/E&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="145.117px" height="40px"&gt;CD_!25&lt;/TD&gt;&lt;TD width="160.359px" height="40px"&gt;05:30:38&lt;/TD&gt;&lt;TD width="57.5234px" height="40px"&gt;&lt;P&gt;URL/F&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="145.117px" height="40px"&gt;CD_125&lt;/TD&gt;&lt;TD width="160.359px" height="40px"&gt;05:30:39&lt;/TD&gt;&lt;TD width="57.5234px" height="40px"&gt;&lt;P&gt;URL/H&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="145.117px" height="40px"&gt;CD_125&lt;/TD&gt;&lt;TD width="160.359px" height="40px"&gt;05:30:41&lt;/TD&gt;&lt;TD width="57.5234px" height="40px"&gt;&lt;P&gt;URL/J&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="145.117px" height="40px"&gt;CD_125&lt;/TD&gt;&lt;TD width="160.359px" height="40px"&gt;05:30:43&lt;/TD&gt;&lt;TD width="57.5234px" height="40px"&gt;&lt;P&gt;URL/E&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="145.117px" height="40px"&gt;CD_125&lt;/TD&gt;&lt;TD width="160.359px" height="40px"&gt;05:30:44&lt;/TD&gt;&lt;TD width="57.5234px" height="40px"&gt;&lt;P&gt;URL/I&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="145.117px" height="40px"&gt;CD_125&lt;/TD&gt;&lt;TD width="160.359px" height="40px"&gt;05:30:45&lt;/TD&gt;&lt;TD width="57.5234px" height="40px"&gt;&lt;P&gt;URL/J&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what I am looking here is duration for each URL/E to URL/J . The output what I am expecting is this.&lt;/P&gt;&lt;P&gt;User_ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Duration&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; URL&lt;/P&gt;&lt;TABLE width="302px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="149.219px" height="25px"&gt;CD_125&lt;/TD&gt;&lt;TD width="103.359px" height="25px"&gt;5&lt;/TD&gt;&lt;TD width="48.4219px" height="25px"&gt;&lt;P&gt;url/E&lt;BR /&gt;url/F&lt;BR /&gt;url/H&lt;BR /&gt;url/J&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="149.219px"&gt;CD_125&lt;/TD&gt;&lt;TD width="103.359px"&gt;2&lt;/TD&gt;&lt;TD width="48.4219px"&gt;&lt;P&gt;url/E&lt;BR /&gt;url/I&lt;BR /&gt;url/J&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would appreciate if someone could guide and help me with the query. thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 06:38:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589616#M205295</guid>
      <dc:creator>bijodev1</dc:creator>
      <dc:date>2022-03-18T06:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Total Duration of a User from one point to Another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589617#M205296</link>
      <description>&lt;LI-CODE lang="markup"&gt;| sort 0 _time
| streamstats count(eval(url="URL/E")) as eCount global=f by user
| reverse
| streamstats count(eval(url="URL/J")) as jCount global=f by user eCount
| eventstats max(jCount) as jMax by user eCount
| eval jeCount=if(jMax&amp;gt;0 AND eCount&amp;gt;0,jMax-jCount+1,0)
| reverse
| where jeCount=1
| sort 0 user _time
| stats range(_time) as duration list(url) as url by user eCount&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 18 Mar 2022 07:13:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589617#M205296</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-18T07:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Total Duration of a User from one point to Another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589623#M205299</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;, it worked perfectly.&lt;/P&gt;&lt;P&gt;Much Appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 07:41:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589623#M205299</guid>
      <dc:creator>bijodev1</dc:creator>
      <dc:date>2022-03-18T07:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Total Duration of a User from one point to Another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589640#M205303</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;why do we have a condition like&amp;nbsp;&lt;BR /&gt;| where jeCount = 1&lt;BR /&gt;&lt;BR /&gt;is it only for when url/E is just once for each transaction&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 08:47:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589640#M205303</guid>
      <dc:creator>bijodev1</dc:creator>
      <dc:date>2022-03-18T08:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Total Duration of a User from one point to Another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589641#M205304</link>
      <description>&lt;P&gt;If URL/J occurs for the user again before the next URL/E, jeCount can become 2 etc. so the condition avoids this situation.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Mar 2022 08:54:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589641#M205304</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-18T08:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Total Duration of a User from one point to Another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589918#M205392</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; thanks&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 04:53:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589918#M205392</guid>
      <dc:creator>bijodev1</dc:creator>
      <dc:date>2022-03-21T04:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Total Duration of a User from one point to Another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589932#M205396</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;I was trying to pull the details for last 15mins for which it displays only 7 events and when I did a normal stats count it shows more than 100+.&lt;/P&gt;&lt;P&gt;Not sure if this query can be tweaked further.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if you can help me why the "reverse" command was used twice. Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 07:33:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589932#M205396</guid>
      <dc:creator>bijodev1</dc:creator>
      <dc:date>2022-03-21T07:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Total Duration of a User from one point to Another</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589940#M205400</link>
      <description>&lt;P&gt;I am not sure what the issue is here - can you share the events or at least an example of the events you think are not being counted when they should be?&lt;/P&gt;&lt;P&gt;Splunk SPL essentially works on a stream or pipeline of events. The streamstats command builds aggregations as it processes the pipeline. The first sort puts the events into ascending time order i.e. earliest first, since this seems to be important for you use case.&lt;/P&gt;&lt;P&gt;It can then find the URL/E.&lt;/P&gt;&lt;P&gt;The first reverse changes the order of the events in the pipeline (similar to sort 0 -_time but quicker!) so that the URL/J can be found&lt;/P&gt;&lt;P&gt;The second reverse restores the order of events in the pipeline to time order. To be fair, this is probably redundant since order is restored by the second sort.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 08:03:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Total-Duration-of-a-User-from-one-point-to-Another/m-p/589940#M205400</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-03-21T08:03:37Z</dc:date>
    </item>
  </channel>
</rss>

