<?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 return first 2 events in a httpSession? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-first-2-events-in-a-httpSession/m-p/526751#M148685</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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're right. I ever thought streamstats count as row by sessionID is to count the number of events in a session.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Cherie&lt;/P&gt;</description>
    <pubDate>Wed, 28 Oct 2020 05:44:29 GMT</pubDate>
    <dc:creator>cheriemilk</dc:creator>
    <dc:date>2020-10-28T05:44:29Z</dc:date>
    <item>
      <title>How to return first 2 events in a httpSession?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-first-2-events-in-a-httpSession/m-p/526591#M148626</link>
      <description>&lt;P&gt;Hi team,&lt;/P&gt;&lt;P&gt;I have below sample raw data in splunk:&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;SPAN&gt;2020-10-27 06:43:56.351 action=view_page httpSessionID = 11&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;2020-10-27 06:43:57.351 action=click_create_button&amp;nbsp; httpSessionID = 11&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;2020-10-27 06:43:58.351 action=save&amp;nbsp; httpSessionID = 11&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;2020-10-28 03:33:33.351 action=view_page&amp;nbsp; httpSessionID = 22&lt;BR /&gt;2020-10-28 03:33:34.351 action=filter&amp;nbsp; httpSessionID = 22&lt;BR /&gt;2020-10-28 03:33:35.351 action=update&amp;nbsp; httpSessionID = 22&lt;BR /&gt;2020-10-29 01:11:11.351 action=view_page&amp;nbsp; httpSessionID = 33&lt;BR /&gt;&lt;BR /&gt;the number of event in a httpSessionID is dynamic. For example: it could be 1, 2, 3, 4....10...20 etc..&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;Now I want splunk to return me the first two events in a httpSessionID,&amp;nbsp; how the query&amp;nbsp; should be?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Cherie&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 07:22:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-first-2-events-in-a-httpSession/m-p/526591#M148626</guid>
      <dc:creator>cheriemilk</dc:creator>
      <dc:date>2020-10-27T07:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to return first 2 events in a httpSession?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-first-2-events-in-a-httpSession/m-p/526596#M148630</link>
      <description>&lt;LI-CODE lang="markup"&gt;| streamstats count as row by sessionId
| where row &amp;lt; 3&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Oct 2020 08:02:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-first-2-events-in-a-httpSession/m-p/526596#M148630</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-27T08:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to return first 2 events in a httpSession?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-first-2-events-in-a-httpSession/m-p/526604#M148635</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; I want it return first 2 events in every httpSession, instead of filtering out the sessions where there're less than 3 events.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Cherie&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 08:56:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-first-2-events-in-a-httpSession/m-p/526604#M148635</guid>
      <dc:creator>cheriemilk</dc:creator>
      <dc:date>2020-10-27T08:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to return first 2 events in a httpSession?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-first-2-events-in-a-httpSession/m-p/526605#M148636</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/218024"&gt;@cheriemilk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you try what I suggested?&lt;/P&gt;&lt;P&gt;The streamstats will effectively add a count to each event within a session i.e the first event for session A will have a row of 1, the second will have a row of 2, and the first event for session B will have a row of 1 etc. Therefore, the only events with row less than 3 are the first two event for each session. You may need to do a reverse beforehand otherwise you may end up with the last two in each session&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| reverse
| streamstats count as row by sessionId
| where row &amp;lt; 3&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Oct 2020 09:10:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-first-2-events-in-a-httpSession/m-p/526605#M148636</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-27T09:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to return first 2 events in a httpSession?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-return-first-2-events-in-a-httpSession/m-p/526751#M148685</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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You're right. I ever thought streamstats count as row by sessionID is to count the number of events in a session.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Cherie&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 05:44:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-return-first-2-events-in-a-httpSession/m-p/526751#M148685</guid>
      <dc:creator>cheriemilk</dc:creator>
      <dc:date>2020-10-28T05:44:29Z</dc:date>
    </item>
  </channel>
</rss>

