<?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: Timechart variation in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36679#M8147</link>
    <description>&lt;P&gt;Kristian, thanks for the reply! But your suggestion can not work for this issue as building of my timechart is preceeded with counting events by user id(for all the time) and selecting only entries with one occurance. &lt;BR /&gt;
(In my case these are users that only registered and have purchased nothing)&lt;BR /&gt;
So timechart that you suggest will take one month statistics and count events by users in this month then for another and so on till the 'earliest' time. And it is needed to count each month in the range [earliest - &lt;MONTH&gt;].&lt;/MONTH&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Apr 2012 09:29:03 GMT</pubDate>
    <dc:creator>iKate</dc:creator>
    <dc:date>2012-04-26T09:29:03Z</dc:date>
    <item>
      <title>Timechart variation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36677#M8145</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Lets say we have time period from Jan 2011 till Jan 2012. Is it possible to build a timechart that count events for each time span (e.g 1month) from the very beginning (Jan 2011)? Normaly timechart counts evants by a span. Also simple sum of previous months results doesn't cover the specific issues of dynamics needed. &lt;/P&gt;

&lt;P&gt;At the moment I built up rather bulky search that uses &lt;CODE&gt;append&lt;/CODE&gt; function for each span and different &lt;CODE&gt;endtime&lt;/CODE&gt; in each appended search. I'm wondering is there more elegant decision of this issue?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2012 07:30:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36677#M8145</guid>
      <dc:creator>iKate</dc:creator>
      <dc:date>2012-04-26T07:30:09Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart variation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36678#M8146</link>
      <description>&lt;P&gt;If this is too simple, please let us know more what you want to achieve.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sourcetype=your_sourcetype earliest=-1y@y latest=@y|  timechart span=1mon count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;UPDATE:&lt;/P&gt;

&lt;P&gt;So what you want is a timechart with a one month granularity, over userIDs who registered but never bought anything (i.e. only occur once in your logs)? Assuming that there are 12 new inactive users registered per month, it would be something like ;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Month           Accumulated_Onetime_users
Jan 2011       12
Feb 2011       24
Mar 2011       36

sourcetype=your_sourcetype earliest=-1y@y latest=@y
| dedup 2 userID 
| transaction userID maxevents=2 
| search eventcount=1 
| bucket _time span=1mon 
| stats count AS Onetime_users by _time 
| accum Onetime_users AS Accumulated_onetime_users
| eval Month = strftime(_time, "%b %Y")
| table Month Accumulated_onetime_users
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm thinking this &lt;EM&gt;should&lt;/EM&gt; work &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; , but I'm doing it all in my head, since I don't have any relevant logs to play with. There probably more efficient ways of doing it, even if it actually does work. &lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;UPDATE:&lt;/P&gt;

&lt;P&gt;Ok now I have tested the search with some real data. The first three lines of the search above (after the sourcetype and time constraints) will find those events that only have a single unique event for the field value. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;dedup 2&lt;/CODE&gt; limits the initial set to two of each, since there is no point in knowing more than that.&lt;BR /&gt;
&lt;CODE&gt;transaction userID maxevents=2&lt;/CODE&gt; groups events together based on the userID. Thus a transaction can have 1 or 2 events.&lt;BR /&gt;
&lt;CODE&gt;search eventcount=1&lt;/CODE&gt; will keep the transactions that only have one event, i.e. the ones we want to find.&lt;/P&gt;

&lt;P&gt;Then we treat all events from the same month as having the same timestamp. (&lt;CODE&gt;bucket _time span=1mon&lt;/CODE&gt;), so we can make counts of events by month. (&lt;CODE&gt;stats count&lt;/CODE&gt;)&lt;BR /&gt;
&lt;CODE&gt;accum&lt;/CODE&gt; keeps a running total of the events.&lt;BR /&gt;
the &lt;CODE&gt;eval Month&lt;/CODE&gt; is for presentation in a nicer way, and the &lt;CODE&gt;table&lt;/CODE&gt; is just showing the results.&lt;/P&gt;

&lt;P&gt;You could add the &lt;CODE&gt;Onetime_users&lt;/CODE&gt; to the table if you wish, to show which were new for each month.&lt;/P&gt;

&lt;P&gt;Let me know if this gives you anything meaningful.&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2012 08:32:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36678#M8146</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-04-26T08:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart variation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36679#M8147</link>
      <description>&lt;P&gt;Kristian, thanks for the reply! But your suggestion can not work for this issue as building of my timechart is preceeded with counting events by user id(for all the time) and selecting only entries with one occurance. &lt;BR /&gt;
(In my case these are users that only registered and have purchased nothing)&lt;BR /&gt;
So timechart that you suggest will take one month statistics and count events by users in this month then for another and so on till the 'earliest' time. And it is needed to count each month in the range [earliest - &lt;MONTH&gt;].&lt;/MONTH&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2012 09:29:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36679#M8147</guid>
      <dc:creator>iKate</dc:creator>
      <dc:date>2012-04-26T09:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart variation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36680#M8148</link>
      <description>&lt;P&gt;Kristian, this is a beautiful search! Thanks for it a lot, it also helped me to learn several new search functions:) I was sure it should work the way I need, but it shows just two or one first months while it can't be so. Moreover span=1mon option doesn't let us see filtered userIDs for each month from the needed time range: [earliest - &lt;MONTH&gt;]. Sory if I explained not so detailed that the desired chart should show the dynamics of such users in time: how much of them were in each month, considering probable correlation with previous months and gathering accumulated result for each month.&lt;/MONTH&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2012 12:25:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36680#M8148</guid>
      <dc:creator>iKate</dc:creator>
      <dc:date>2012-04-26T12:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart variation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36681#M8149</link>
      <description>&lt;P&gt;At the moment I explicitly state the time for each month that is not so well.&lt;/P&gt;

&lt;P&gt;source="A" OR source="B" starttime=01/01/2011:00:00:00 latest=now | stats count as activity by user_id | where activity = 1 | eval t=case(activity = 1, "this month") | chart count by t | &lt;BR /&gt;
append [ search source="A" OR source="B" starttime=01/01/2011:00:00:00 endtime=02/01/2011:00:00:00 | stats count as activity by user_id | where activity = 1 | eval t=case((activity = 1) AND (1296518400 &amp;lt; time()), "2011.01") | chart count by t ] |&lt;BR /&gt;
append [...]&lt;BR /&gt;
...&lt;BR /&gt;
chart max(count) by t &lt;/P&gt;

&lt;P&gt;10 digits: converted to epochtime 'endtime':)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:44:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36681#M8149</guid>
      <dc:creator>iKate</dc:creator>
      <dc:date>2020-09-28T11:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart variation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36682#M8150</link>
      <description>&lt;P&gt;Sorry if I misunderstand what you want to achieve - but the search I provided does work the way I said. See update above. &lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2012 08:59:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36682#M8150</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-04-27T08:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart variation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36683#M8151</link>
      <description>&lt;P&gt;This is a letter to myself in the past:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Dear Kate! &lt;BR /&gt;
You should use Summary Indexing together with backfill mechanism! Here is a beginning of your road for convenient and fast work with historical data:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.3/Knowledge/Usesummaryindexing"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.3/Knowledge/Usesummaryindexing&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.3/Knowledge/Managesummaryindexgapsandoverlaps"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.3/Knowledge/Managesummaryindexgapsandoverlaps&lt;/A&gt;&lt;BR /&gt;
What a pity that you'll stumble upon this information that late. But still it's so good you'll got to know it.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2012 09:58:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36683#M8151</guid>
      <dc:creator>iKate</dc:creator>
      <dc:date>2012-09-17T09:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart variation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36684#M8152</link>
      <description>&lt;P&gt;Kristian, some time ago finally I found the the core solving of the question that I felt should surely exist. The answer is below)&lt;/P&gt;</description>
      <pubDate>Mon, 17 Sep 2012 10:07:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-variation/m-p/36684#M8152</guid>
      <dc:creator>iKate</dc:creator>
      <dc:date>2012-09-17T10:07:13Z</dc:date>
    </item>
  </channel>
</rss>

