<?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: Outputlookup Removes Multivalue Fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176567#M50722</link>
    <description>&lt;P&gt;So as I understand it a lookup table can only hold four types of data (number boolean, time and string). So when you send a multivalue field into a lookup it gets created as a string, which is not usable by mvexpand or the other mv commands. However, you can split the data with a delimiter using mvjoin: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | eval &amp;lt;new field&amp;gt;=mvjoin(&amp;lt;original field&amp;gt;, "&amp;lt;delimiter&amp;gt;") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This then gives you a sting with a delimiter between each entry (e.g. TCP,TCP,TCP). Once you have that you can then convert this back into a multivalue field when you search the lookup table using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | makemv delim="&amp;lt;delimiter&amp;gt;" &amp;lt;field&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Aug 2015 16:31:37 GMT</pubDate>
    <dc:creator>peter_holmes_an</dc:creator>
    <dc:date>2015-08-27T16:31:37Z</dc:date>
    <item>
      <title>Outputlookup Removes Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176563#M50718</link>
      <description>&lt;P&gt;I had an extremely expensive query that would return results in this format:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/565iEE3F80675773160E/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I needed to speed up the query because it was taking 3 minutes to load on the dashboard, so I converted it into a lookup table via outputlookup.  Now, when I run inputlookup against the newly created lookup, it does not have the values seperated into new lines.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/566i8E37CE3A9314CD78/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I have tried running mvexpand against the columns but nothing happens.  When I export the results, the csv has all the fields on their own lines as in the first screen shot.  &lt;/P&gt;

&lt;P&gt;How can I have the lookup table retain the formatting of the source table?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2015 21:27:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176563#M50718</guid>
      <dc:creator>david_rose</dc:creator>
      <dc:date>2015-08-17T21:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Outputlookup Removes Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176564#M50719</link>
      <description>&lt;P&gt;You need to link the 3 values together so that their relationship across columns is maintained; otherwise each column's values will be treated totally independently as unrelated multivalued fields.&lt;/P&gt;

&lt;P&gt;So instead of something like this (which you are currently using):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;VIP,Risk,Port,Protocol
1.2.3.4,High,443,TCP
1.2.3.4,Medium,80,TCP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;VIP,Risk-Port-Protocol
1.2.3.4,High-443-TCP
1.2.3.4,Medium-80-TCP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If necessary, you can split the fields out to separate them after the lookup, but I don't see the point&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2015 06:59:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176564#M50719</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-18T06:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Outputlookup Removes Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176565#M50720</link>
      <description>&lt;P&gt;Why were the multi events removed when i created the lookup though?  The data was structured fine beforehand.&lt;/P&gt;

&lt;P&gt;I tried as you suggested by combing those fields in the original table with:&lt;/P&gt;

&lt;P&gt;eval "Risk Details"='Risk'."-".'Port'."-".'Protocol'&lt;/P&gt;

&lt;P&gt;But it ignores the multivalue fields and only concatenates the single value ones.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2015 14:07:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176565#M50720</guid>
      <dc:creator>david_rose</dc:creator>
      <dc:date>2015-08-18T14:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Outputlookup Removes Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176566#M50721</link>
      <description>&lt;P&gt;Because when you call &lt;CODE&gt;outputcsv&lt;/CODE&gt; each line must have the same number of fields therefore it does not create any multivalued fields and does an implicit &lt;CODE&gt;mvexpand&lt;/CODE&gt; before writing them out (it is, after all, creating a CSV).  So you need to create a triple-combo field and do the &lt;CODE&gt;outputcsv&lt;/CODE&gt; again and even then, you are going to have to use &lt;CODE&gt;makemv&lt;/CODE&gt; (and other commands) when you pull it back out to recreate what you had originally.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Aug 2015 23:06:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176566#M50721</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-20T23:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Outputlookup Removes Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176567#M50722</link>
      <description>&lt;P&gt;So as I understand it a lookup table can only hold four types of data (number boolean, time and string). So when you send a multivalue field into a lookup it gets created as a string, which is not usable by mvexpand or the other mv commands. However, you can split the data with a delimiter using mvjoin: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | eval &amp;lt;new field&amp;gt;=mvjoin(&amp;lt;original field&amp;gt;, "&amp;lt;delimiter&amp;gt;") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This then gives you a sting with a delimiter between each entry (e.g. TCP,TCP,TCP). Once you have that you can then convert this back into a multivalue field when you search the lookup table using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | makemv delim="&amp;lt;delimiter&amp;gt;" &amp;lt;field&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Aug 2015 16:31:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176567#M50722</guid>
      <dc:creator>peter_holmes_an</dc:creator>
      <dc:date>2015-08-27T16:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: Outputlookup Removes Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176568#M50723</link>
      <description>&lt;P&gt;You are not hearing me.  You need to maintain the relationship between these 3 fields: &lt;CODE&gt;Risk&lt;/CODE&gt;, &lt;CODE&gt;Port&lt;/CODE&gt;, &amp;amp; &lt;CODE&gt;Protocol&lt;/CODE&gt;.  You created these with the &lt;CODE&gt;list&lt;/CODE&gt; function (e.g. &lt;CODE&gt;list(Risk) AS Risk&lt;/CODE&gt; and this maintains a "rowish" order so you can see that the first triplet is &lt;CODE&gt;High&lt;/CODE&gt; / &lt;CODE&gt;443&lt;/CODE&gt; / &lt;CODE&gt;TCP&lt;/CODE&gt;.  If you do not export these together, you will &lt;EM&gt;lose&lt;/EM&gt; this relationship.  You must do it the way I have already described (by linking them together as a single field).  If you are using &lt;CODE&gt;outputscv&lt;/CODE&gt; then do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...  | eval Risk_Port_Protocol = Risk . "-" . Port . "-" Protocol | stats values(Risk_Port_Protocol) by vIP Host | fields vIP Risk_Port_Protocol | outputcsv SomeFile.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, when you read it back in it will look correct.  This is the &lt;EM&gt;only&lt;/EM&gt; way to do it (right).  If you persist in a non-joined method, then you will be wasting your time because it will never be correct.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Aug 2015 23:32:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176568#M50723</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-27T23:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Outputlookup Removes Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176569#M50724</link>
      <description>&lt;P&gt;try using &lt;STRONG&gt;&lt;EM&gt;&lt;CODE&gt;output_format=splunk_mv_csv&lt;/CODE&gt;&lt;/EM&gt;&lt;/STRONG&gt; option with outputlookup&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|outputlookup output_format=splunk_mv_csv &amp;lt;lookupname&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Oct 2019 06:16:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/176569#M50724</guid>
      <dc:creator>nikhiltyagi</dc:creator>
      <dc:date>2019-10-21T06:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Outputlookup Removes Multivalue Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/553416#M157130</link>
      <description>&lt;P&gt;This is the proper solution!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 May 2021 21:53:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Outputlookup-Removes-Multivalue-Fields/m-p/553416#M157130</guid>
      <dc:creator>cyamal1b4</dc:creator>
      <dc:date>2021-05-27T21:53:53Z</dc:date>
    </item>
  </channel>
</rss>

