<?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: Summary / accelerate query counting disjoint indexed events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198412#M57371</link>
    <description>&lt;P&gt;Yeah, feeding that into a summary index will give you great long-term statistics performance.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Mar 2014 22:48:07 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2014-03-24T22:48:07Z</dc:date>
    <item>
      <title>Summary / accelerate query counting disjoint indexed events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198409#M57368</link>
      <description>&lt;P&gt;I have a relatively large number of events being indexed and funneled into its own index based on source &amp;amp; source type (millions a week). This stream of events contains information about user activity in a product of ours and we desire to summarize user activity on a daily basis then build a dashboard that visualizes this summary information in various ways (often on longer timescales). We will likely utilize an accelerated search (prefer the simplicity) but may decide to use a summary search.&lt;/P&gt;

&lt;P&gt;Note we are currently still using splunk 5.0.5.&lt;/P&gt;

&lt;P&gt;The following is an example of a summary query that I am experimenting with and I am looking for any suggestions on how to improve it. It seems a little wrong to use if/match like I am. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myproduct build_type=prod (event_type="creating shape" OR event_type="Selecting tool" OR event_type="Undoing shape" OR event_type="Redoing shape") | eval DrawEvent=if(match(event_type,"creating shape"),"1","0") | eval ToolEvent=if(match(event_type,"Selecting tool"),"1","0") | eval UndoEvent=if(match(event_type,"Undoing shape"),"1","0") | eval RedoEvent=if(match(event_type,"Redoing shape"),"1","0") | bucket _time span=1day | stats sum(DrawEvent) AS UserDrawCount sum(ToolEvent) AS UserToolCount sum(UndoEvent) AS UserUndoCount sum(RedoEvent) AS UserRedoCount by _time,logged_user_id
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...which produces a table like the following...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    _time   logged_user_id  UserDrawCount   UserToolCount   UserUndoCount   UserRedoCount
1   3/16/14 12:00:00.000 AM AAAAA   59  7   0   0
2   3/16/14 12:00:00.000 AM BBBBBB  135 35  42  2
3   3/16/14 12:00:00.000 AM CCCCC   139 3   0   0
4   3/16/14 12:00:00.000 AM DDDDD   895 65  54  1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note in a future version of the product we are reworking the naming conventions used to allow for a wildcard to be used in the search (instead of such specific text) to narrow down the event stream to a family of user actions we wish to summarize in the same query.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 18:38:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198409#M57368</guid>
      <dc:creator>shawnce</dc:creator>
      <dc:date>2014-03-24T18:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Summary / accelerate query counting disjoint indexed events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198410#M57369</link>
      <description>&lt;P&gt;Maybe it's just me, but what is your question?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 21:40:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198410#M57369</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-24T21:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Summary / accelerate query counting disjoint indexed events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198411#M57370</link>
      <description>&lt;P&gt;I am basically looking to see if what I am doing about is reasonable or if a better way exists.&lt;/P&gt;

&lt;P&gt;I have a stream of events like the following coming in from users using our app...&lt;/P&gt;

&lt;P&gt;logged_user_id="AAAAA" event_type="creating shape" ...&lt;BR /&gt;
logged_user_id="BBBBBB" event_type="Selecting tool" ...&lt;BR /&gt;
logged_user_id="AAAAA" event_type="creating shape" ...&lt;BR /&gt;
logged_user_id="CCCCC" event_type="Redoing shape" ...&lt;/P&gt;

&lt;P&gt;I want to summarize this into a daily tally of each type of event by user, so turning multiple events into a single event for each user on each day. This will then be used to feed sub searches.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:13:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198411#M57370</guid>
      <dc:creator>shawnce</dc:creator>
      <dc:date>2020-09-28T16:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Summary / accelerate query counting disjoint indexed events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198412#M57371</link>
      <description>&lt;P&gt;Yeah, feeding that into a summary index will give you great long-term statistics performance.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 22:48:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198412#M57371</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-24T22:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: Summary / accelerate query counting disjoint indexed events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198413#M57372</link>
      <description>&lt;P&gt;Basically is searching on event_type to narrow the number of events looked at followed by using eval=if(match(...) to tally each event_type matched, then bucketing by day, then summarizing using stats makes sense... or does a better way exist to do the daily summary not using the eval=if(match(..)) stuff but maybe features of stats more directly?&lt;/P&gt;

&lt;P&gt;Again it needs to be grouped by day and logged in user.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:13:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198413#M57372</guid>
      <dc:creator>shawnce</dc:creator>
      <dc:date>2020-09-28T16:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Summary / accelerate query counting disjoint indexed events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198414#M57373</link>
      <description>&lt;P&gt;You could merge the match into the stats like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats count(eval(match(event_type, "creating shape"))) as UserDrawCount ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But that's not necessarily better to read and maintain. From a performance point of view it's not going to matter much.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 22:50:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198414#M57373</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-24T22:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Summary / accelerate query counting disjoint indexed events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198415#M57374</link>
      <description>&lt;P&gt;All in all - yeah, seems reasonable to me.&lt;/P&gt;

&lt;P&gt;Consider moving the categorizing-eval-chain out into a macro for easy reuse and maintenance.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2014 22:56:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-accelerate-query-counting-disjoint-indexed-events/m-p/198415#M57374</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-24T22:56:54Z</dc:date>
    </item>
  </channel>
</rss>

