<?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: How do I prevent the collect command from flattening multivalue fields when writing into a summary index? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157702#M1519</link>
    <description>&lt;P&gt;Well, the idea is to do complicated stuff once - when collecting - and do simple stuff many times - when searching.&lt;/P&gt;</description>
    <pubDate>Sun, 26 Apr 2015 22:47:07 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2015-04-26T22:47:07Z</dc:date>
    <item>
      <title>How do I prevent the collect command from flattening multivalue fields when writing into a summary index?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157697#M1514</link>
      <description>&lt;P&gt;I want to write transactions with full list of pages accessed into summary index in this manner:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | transaction ip maxpause=15m mvlist=page | fields _time, ip, page | fields - _raw | collect index=my_summary
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But the resulting summary index contains the 'page' field in flattened format, no longer multivalue.&lt;/P&gt;

&lt;P&gt;Is this documented behavior? Can I force my summary index to keep fields in multivalue format, or do I need to do &lt;CODE&gt;makemv&lt;/CODE&gt; every time I want to search my summary index?&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2015 17:22:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157697#M1514</guid>
      <dc:creator>gesman</dc:creator>
      <dc:date>2015-04-26T17:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I prevent the collect command from flattening multivalue fields when writing into a summary index?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157698#M1515</link>
      <description>&lt;P&gt;Hi, Try using mvlist=t&lt;/P&gt;

&lt;P&gt;mvlist =&amp;lt; bool &amp;gt; | &lt;BR /&gt;
Description: Flag controlling&lt;BR /&gt;
whether the multivalued fields of&lt;BR /&gt;
the transaction are (mvlist = t) a&lt;BR /&gt;
list of the original events ordered&lt;BR /&gt;
in arrival order or (mvlist = f ) a&lt;BR /&gt;
set of unique field values ordered&lt;BR /&gt;
lexigraphically . If a comma / space&lt;BR /&gt;
delimited list of fields is provided&lt;BR /&gt;
only those fields are rendered as&lt;BR /&gt;
lists . Defaults to f .&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/"&gt;http://docs.splunk.com/Documentation/Splunk/latest/&lt;/A&gt;&lt;BR /&gt;
SearchReference/Transaction&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2015 17:38:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157698#M1515</guid>
      <dc:creator>stephane_cyrill</dc:creator>
      <dc:date>2015-04-26T17:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I prevent the collect command from flattening multivalue fields when writing into a summary index?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157699#M1516</link>
      <description>&lt;P&gt;Thanks for your effort, but my question is about multivalue field losing it's format when transferred into summary index, and not about the way transaction creates these fields.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2015 17:53:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157699#M1516</guid>
      <dc:creator>gesman</dc:creator>
      <dc:date>2015-04-26T17:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I prevent the collect command from flattening multivalue fields when writing into a summary index?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157700#M1517</link>
      <description>&lt;P&gt;One way to tackle this could be to un-mv your field before collecting, adding a delimiter between the values. Using that delimiter you could then set up field extractions with &lt;CODE&gt;MV_ADD&lt;/CODE&gt; to avoid doing the mv dance in the search itself.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2015 21:43:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157700#M1517</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-04-26T21:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I prevent the collect command from flattening multivalue fields when writing into a summary index?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157701#M1518</link>
      <description>&lt;P&gt;Right now I ending up with this:&lt;BR /&gt;
&lt;CODE&gt;index=my_summary | makemv delim="|" ips  | makemv delim="|" uas  | makemv delim="|" usernames   ...&lt;/CODE&gt;&lt;BR /&gt;
to recreated multivalue fields in a proper manner. Which doesn't seems to impact performance much, so temporarily I'm happy with this.&lt;/P&gt;

&lt;P&gt;Thanks for the tip though - good to be aware of alternatives.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2015 21:57:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157701#M1518</guid>
      <dc:creator>gesman</dc:creator>
      <dc:date>2015-04-26T21:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I prevent the collect command from flattening multivalue fields when writing into a summary index?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157702#M1519</link>
      <description>&lt;P&gt;Well, the idea is to do complicated stuff once - when collecting - and do simple stuff many times - when searching.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2015 22:47:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157702#M1519</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-04-26T22:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I prevent the collect command from flattening multivalue fields when writing into a summary index?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157703#M1520</link>
      <description>&lt;P&gt;try  with &lt;CODE&gt;table&lt;/CODE&gt; command.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|table _time   ip page | fields - _raw | collect index=my_summar
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Apr 2015 20:33:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157703#M1520</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2015-04-27T20:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I prevent the collect command from flattening multivalue fields when writing into a summary index?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157704#M1521</link>
      <description>&lt;P&gt;Same result. Multivalues flattened to single string.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 02:07:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157704#M1521</guid>
      <dc:creator>gesman</dc:creator>
      <dc:date>2015-04-28T02:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I prevent the collect command from flattening multivalue fields when writing into a summary index?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157705#M1522</link>
      <description>&lt;P&gt;Hi Martin,&lt;BR /&gt;
with &lt;CODE&gt;MV_ADD&lt;/CODE&gt; approach what else do i need to do to make it happen automagically?&lt;BR /&gt;
I've looked into &lt;CODE&gt;DELIM&lt;/CODE&gt; param but still not sure if it applies to my case, or whether I need any other params to customize?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 15:21:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157705#M1522</guid>
      <dc:creator>gesman</dc:creator>
      <dc:date>2015-04-28T15:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I prevent the collect command from flattening multivalue fields when writing into a summary index?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157706#M1523</link>
      <description>&lt;P&gt;One of the working solution is to add this to &lt;CODE&gt;./etc/system/local/fields.conf&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[ips]
TOKENIZER = ([^\|]+)

[uas]
TOKENIZER = ([^\|]+)

[usernames]
TOKENIZER = ([^\|]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This would do the same job as this: &lt;CODE&gt;... | makemv delim="|" ips | makemv delim="|" uas | makemv delim="|" usernames ...&lt;/CODE&gt;&lt;BR /&gt;
(doesn't seems to require using of &lt;CODE&gt;MV_ADD&lt;/CODE&gt; in transforms)&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2015 02:06:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157706#M1523</guid>
      <dc:creator>gesman</dc:creator>
      <dc:date>2015-04-29T02:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I prevent the collect command from flattening multivalue fields when writing into a summary index?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157707#M1524</link>
      <description>&lt;P&gt;To note: there is actually benefit of having multivalues flattened and separated by some character.&lt;BR /&gt;
"Flattened" values (say 'usernames') is searchable via &lt;CODE&gt;index=logs usernames=*johnsmith* | ...&lt;/CODE&gt; query vs. multivalues are not.&lt;/P&gt;

&lt;P&gt;So in above case if I'd need to find only events where one of the username is (or contains) 'johnsmith' - that would work nicely and reduce number of events before pipe.&lt;/P&gt;

&lt;P&gt;If usernames would be stored in multivalued format - we'd need to use slower logic to either flatten usernames first or use functions like &lt;CODE&gt;mvfilter&lt;/CODE&gt; to search everything.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2015 19:37:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157707#M1524</guid>
      <dc:creator>gesman</dc:creator>
      <dc:date>2015-05-01T19:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I prevent the collect command from flattening multivalue fields when writing into a summary index?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157708#M1525</link>
      <description>&lt;P&gt;Nitpicking point: If you're searching for &lt;CODE&gt;johnsmith&lt;/CODE&gt; as a &lt;CODE&gt;username&lt;/CODE&gt; value, searching for &lt;CODE&gt;username=*johnsmith*&lt;/CODE&gt; will lead to tears if you have a &lt;CODE&gt;johnsmithy&lt;/CODE&gt;...&lt;/P&gt;

&lt;P&gt;Usually, doing &lt;CODE&gt;field=value&lt;/CODE&gt; in a search will be translated to "value is in field" if field is a multivalue field, so make sure it really doesn't work for you. Sample search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count | eval foo = "a b c" | makemv foo | search foo="b"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That'll keep the one row, because foo contains a value of b.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2015 21:06:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-do-I-prevent-the-collect-command-from-flattening-multivalue/m-p/157708#M1525</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-05-01T21:06:16Z</dc:date>
    </item>
  </channel>
</rss>

