<?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: Determining how many visits before an action is taken in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Determining-how-many-visits-before-an-action-is-taken/m-p/65735#M16310</link>
    <description>&lt;P&gt;thanks. using stats with the "values" function is the key to getting the correct data.&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jan 2013 12:39:31 GMT</pubDate>
    <dc:creator>brettcave</dc:creator>
    <dc:date>2013-01-23T12:39:31Z</dc:date>
    <item>
      <title>Determining how many visits before an action is taken</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-how-many-visits-before-an-action-is-taken/m-p/65733#M16308</link>
      <description>&lt;P&gt;I am trying to determine the number of visits a user makes before a certain action takes place in a report. I have a visitorId, a sessionId and classification of event types, but I am not sure how to determine this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;VisitorId="x" SessionId="a" uri="/"
VisitorId="x" SessionId="b" uri="/login"
VisitorId="x" SessionId="c" uri="/login"
VisitorId="x" SessionId="c" action="updateProfile" &amp;lt;-- logged via a different mechanism
VisitorId="x" SessionId="d" uri="/about"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the example, a visitor has had 4 sessions. They updated their profile during their 3rd session. &lt;/P&gt;

&lt;P&gt;I was thinking of using a transaction by VisitorID, with an endswith being eventtype=UpdateProfile (the event type being defined as having an action of updateProfile), but cannot do a distinct mvcount on SessionId. How could I go about determining the number of distinct sessionIds by visitorId before a certain event takes place?&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2012 09:50:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-how-many-visits-before-an-action-is-taken/m-p/65733#M16308</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2012-09-20T09:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Determining how many visits before an action is taken</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-how-many-visits-before-an-action-is-taken/m-p/65734#M16309</link>
      <description>&lt;P&gt;If SessionIds are unique per host, something like this might work.  This assumes action is an explicit field, but if it isn't, you might search on _raw instead.  Also it only identifies the first updateProfile occurrence; if you want to find them all I can try tweaking this.&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
... transaction VisitorId,SessionId | eval keyevent=if(isnotnull(mvfind(action,"updateProfile")),SessionId,null) | stats earliest(keyevent) as earliest, values(SessionId) as sessions by VisitorId | eval num=mvfind(sessions,earliest) | eval num=if(isnotnull(num), num+1,null) | table host, earliest, sessions, num&lt;BR /&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2012 15:11:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-how-many-visits-before-an-action-is-taken/m-p/65734#M16309</guid>
      <dc:creator>cphair</dc:creator>
      <dc:date>2012-09-20T15:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Determining how many visits before an action is taken</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-how-many-visits-before-an-action-is-taken/m-p/65735#M16310</link>
      <description>&lt;P&gt;thanks. using stats with the "values" function is the key to getting the correct data.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2013 12:39:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-how-many-visits-before-an-action-is-taken/m-p/65735#M16310</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2013-01-23T12:39:31Z</dc:date>
    </item>
  </channel>
</rss>

