<?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: Multivalue field for summary index in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60926#M15011</link>
    <description>&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2013 09:26:59 GMT</pubDate>
    <dc:creator>sc0tt</dc:creator>
    <dc:date>2013-06-19T09:26:59Z</dc:date>
    <item>
      <title>Multivalue field for summary index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60917#M15002</link>
      <description>&lt;P&gt;I have a multi-value field "activity" that can be very long and contain many unique values (60+). I want to be able to summarize the count of activities per hour per user in order to populate a summary index. I've used mvexpand and the chart command to create a new field based on each value and count, but I receive the following message "chart command has reached the limit for data points" even when using limit=0 (Splunk 4.3.5). If I simply do a count by activity then I'll receive many more events than is in the actual source. For example, a day with 40,000 events would create a summary of 200,000+ events.&lt;/P&gt;

&lt;P&gt;In order to keep the summary as concise as possible, is there a way to transform a multi-value field from something like &lt;CODE&gt;activity="viewMailbox compose send compose send compose save"&lt;/CODE&gt; to &lt;CODE&gt;activity_count="viewMailbox=1 compose=3 send=2 save=1"&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;If not, is there any issue with creating a summary that results in much more data than is contained in the actual source? Should I be trying to summarize this in a different way that is more efficient for Splunk?&lt;/P&gt;

&lt;P&gt;Many thanks in advance!&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Updated for solution&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Just wanted to follow up with what I finally did. First, I created a new multi value field by using &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| makemv delim=" " activity | mvexpand activity &lt;BR /&gt;
| stats count(activity) as count by activity &lt;BR /&gt;
| eval activity_count=activity."=".count&lt;BR /&gt;
| stats values(activity_count) as activity sum(count) as count&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This gave me a new multi value field:&lt;BR /&gt;
&lt;CODE&gt;activity_count="viewMailbox=1,compose=3,send=2,save=1"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I then use &lt;CODE&gt;mvindex&lt;/CODE&gt; to separate the key value pairs at search time when needed.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| eval activity_count=split(activity,"=") &lt;BR /&gt;
| eval activity=mvindex(activity_count,0) &lt;BR /&gt;
| eval count=mvindex(activity_count,1)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This works for my needs. Hope this helps somebody else.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 09:33:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60917#M15002</guid>
      <dc:creator>sc0tt</dc:creator>
      <dc:date>2013-06-12T09:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: Multivalue field for summary index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60918#M15003</link>
      <description>&lt;P&gt;what about &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | stats values(activity) as distinct_list by User 
| eval distinct_activities=mvcount(distinct_list)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jun 2013 11:29:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60918#M15003</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2013-06-12T11:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Multivalue field for summary index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60919#M15004</link>
      <description>&lt;P&gt;Thanks for the suggestion. I don't want to count the number of distinct activities, I want to be able to count the number of times an activity appears in the list. I know I can use mvexpand and get something like:&lt;/P&gt;

&lt;P&gt;user activity count&lt;BR /&gt;
1     send      2&lt;BR /&gt;
1     compose   3&lt;BR /&gt;&lt;BR /&gt;
1     save      1&lt;/P&gt;

&lt;P&gt;But I would really like to have this&lt;/P&gt;

&lt;P&gt;user activity_count&lt;BR /&gt;
1      send(2)&lt;BR /&gt;
       compose(3)&lt;BR /&gt;
       save(1)&lt;/P&gt;

&lt;P&gt;Is this possible?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2013 13:15:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60919#M15004</guid>
      <dc:creator>sc0tt</dc:creator>
      <dc:date>2013-06-13T13:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Multivalue field for summary index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60920#M15005</link>
      <description>&lt;P&gt;if you have a predefined list of activities that can be hard-coded in the query, maybe use "eval" in the chart / stats in some way.. you may still need to use an mvexpand to get the events into the correct format though... &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | stats c(eval(activity="compose")) as compose_count c(eval(activity="send")) as send_count&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;or maybe expand + chart c over ... by ... (not sure if you are still getting the limit issue with this).&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | activity_mv=split(activity," ") | mvexpand activity_mv | chart c over activity_mv by userId&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2013 13:49:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60920#M15005</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2013-06-13T13:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Multivalue field for summary index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60921#M15006</link>
      <description>&lt;P&gt;That's part of the issue. I could hard code but there are currently 60+ activities which will continue to increase over time and using the chart over is causing the error  "chart command has reached the limit for data points" even when using the &lt;CODE&gt;limit=0&lt;/CODE&gt;. I'm unsure why I am reaching the limit when using this option. This is why I'm trying to come up with another workable solution. I may just have to use &lt;CODE&gt;| mvexpand activity | bucket _time span=1h | stats count by activity user _time&lt;/CODE&gt; although this would create a very large summary.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2013 14:18:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60921#M15006</guid>
      <dc:creator>sc0tt</dc:creator>
      <dc:date>2013-06-13T14:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Multivalue field for summary index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60922#M15007</link>
      <description>&lt;P&gt;about about &lt;CODE&gt;mvexpand | chart c over expanded_activity by user_id&lt;/CODE&gt; ?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2013 14:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60922#M15007</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2013-06-13T14:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multivalue field for summary index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60923#M15008</link>
      <description>&lt;P&gt;I think I'm making progress. I was able to create a field called activity_count that is formatted as &lt;CODE&gt;activity_count="viewMailbox=1 compose=3 send=2 save=1"&lt;/CODE&gt;. Now, is it possible to then extract the key value pairs at search time so that I could know that compose is 3?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:06:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60923#M15008</guid>
      <dc:creator>sc0tt</dc:creator>
      <dc:date>2020-09-28T14:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Multivalue field for summary index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60924#M15009</link>
      <description>&lt;P&gt;Updated original post with my final solution since it wouldn't fit in the comment.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2013 18:32:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60924#M15009</guid>
      <dc:creator>sc0tt</dc:creator>
      <dc:date>2013-06-17T18:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Multivalue field for summary index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60925#M15010</link>
      <description>&lt;P&gt;| eval activity_mv=split(activity_count," ") | mvexpand activity_mv | eval activity_list=split(activity_mv,"=") | eval key=mvindex(activity_list,0) | eval value=mvindex(activity_list,1)&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:07:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60925#M15010</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2020-09-28T14:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: Multivalue field for summary index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60926#M15011</link>
      <description>&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2013 09:26:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60926#M15011</guid>
      <dc:creator>sc0tt</dc:creator>
      <dc:date>2013-06-19T09:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Multivalue field for summary index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60927#M15012</link>
      <description>&lt;P&gt;nicely done&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2013 11:01:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multivalue-field-for-summary-index/m-p/60927#M15012</guid>
      <dc:creator>brettcave</dc:creator>
      <dc:date>2013-06-19T11:01:00Z</dc:date>
    </item>
  </channel>
</rss>

