<?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 Consequent days measurement? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Consequent-days-measurement/m-p/50912#M12241</link>
    <description>&lt;P&gt;Hi, Let's say "user X" visited my site on these dates:&lt;BR /&gt;
2/3/2012&lt;BR /&gt;
2/4/2012&lt;BR /&gt;
2/5/2012&lt;BR /&gt;
10/5/2012&lt;BR /&gt;
11/5/2012&lt;/P&gt;

&lt;P&gt;How can I count the number of consequent days "user X" visited?&lt;BR /&gt;
I would like for the output to be&lt;/P&gt;

&lt;P&gt;User X - 3 (consequent days)&lt;BR /&gt;
User X - 2 (consequent days)&lt;/P&gt;

&lt;P&gt;I'll appreciate any ideas:)&lt;/P&gt;</description>
    <pubDate>Sun, 13 May 2012 11:25:36 GMT</pubDate>
    <dc:creator>Yarsa</dc:creator>
    <dc:date>2012-05-13T11:25:36Z</dc:date>
    <item>
      <title>Consequent days measurement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consequent-days-measurement/m-p/50912#M12241</link>
      <description>&lt;P&gt;Hi, Let's say "user X" visited my site on these dates:&lt;BR /&gt;
2/3/2012&lt;BR /&gt;
2/4/2012&lt;BR /&gt;
2/5/2012&lt;BR /&gt;
10/5/2012&lt;BR /&gt;
11/5/2012&lt;/P&gt;

&lt;P&gt;How can I count the number of consequent days "user X" visited?&lt;BR /&gt;
I would like for the output to be&lt;/P&gt;

&lt;P&gt;User X - 3 (consequent days)&lt;BR /&gt;
User X - 2 (consequent days)&lt;/P&gt;

&lt;P&gt;I'll appreciate any ideas:)&lt;/P&gt;</description>
      <pubDate>Sun, 13 May 2012 11:25:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consequent-days-measurement/m-p/50912#M12241</guid>
      <dc:creator>Yarsa</dc:creator>
      <dc:date>2012-05-13T11:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Consequent days measurement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consequent-days-measurement/m-p/50913#M12242</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere | 
bucket _time span=1d | 
dedup user _time | 
transaction user maxpause=1d |
table user eventcount | sort user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After you have done your search, whatever it is, the commands that follow&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;group the time by day - ignoring hours, minutes, etc.&lt;/LI&gt;
&lt;LI&gt;eliminate multiple events from the same user on the same day, leaving a max of 1 event per user per day&lt;/LI&gt;
&lt;LI&gt;group the events into transactions based on the user name, with the provision that there cannot be a gap of greater that a day between events in the transaction&lt;/LI&gt;
&lt;LI&gt;for each user, list the number of events&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 14 May 2012 05:24:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consequent-days-measurement/m-p/50913#M12242</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-05-14T05:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Consequent days measurement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consequent-days-measurement/m-p/50914#M12243</link>
      <description>&lt;P&gt;Thanks:) it works very good.&lt;BR /&gt;
I was also wondering if there is a way to define a condition to limit events with 8 hour difference between them when they occur on two consecutive days.&lt;/P&gt;

&lt;P&gt;For example when the user visited on&lt;BR /&gt;
2/3/2012 23:50&lt;BR /&gt;
2/4/2012 00:15&lt;/P&gt;

&lt;P&gt;I don't want to count this case as two consecutive days.&lt;/P&gt;

&lt;P&gt;Is it possible or I'm asking too much?&lt;BR /&gt;
thanks&lt;/P&gt;</description>
      <pubDate>Mon, 14 May 2012 08:28:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consequent-days-measurement/m-p/50914#M12243</guid>
      <dc:creator>Yarsa</dc:creator>
      <dc:date>2012-05-14T08:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: Consequent days measurement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consequent-days-measurement/m-p/50915#M12244</link>
      <description>&lt;P&gt;I couldn't figure out how to do that, but this version will list the date/times for each user along with the count:&lt;/P&gt;

&lt;P&gt;yoursearchhere |&lt;BR /&gt;&lt;BR /&gt;
fields user | eval datetime=strftime(_time,"%x %X") |&lt;BR /&gt;&lt;BR /&gt;
bucket _time span=1d |&lt;BR /&gt;&lt;BR /&gt;
dedup user _time |&lt;BR /&gt;&lt;BR /&gt;
transaction user maxpause=1d mvlist=datetime|&lt;BR /&gt;&lt;BR /&gt;
sort user _time |&lt;BR /&gt;&lt;BR /&gt;
table user eventcount datetime&lt;/P&gt;</description>
      <pubDate>Tue, 15 May 2012 18:51:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consequent-days-measurement/m-p/50915#M12244</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-05-15T18:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Consequent days measurement?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Consequent-days-measurement/m-p/50916#M12245</link>
      <description>&lt;P&gt;Ok thanks very much:)&lt;/P&gt;</description>
      <pubDate>Thu, 17 May 2012 07:42:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Consequent-days-measurement/m-p/50916#M12245</guid>
      <dc:creator>Yarsa</dc:creator>
      <dc:date>2012-05-17T07:42:16Z</dc:date>
    </item>
  </channel>
</rss>

