<?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 to add multi-values lookups in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311464#M4214</link>
    <description>&lt;P&gt;What do you get when you search for |inputlookup lookup_name ? How do you intend to use those results?&lt;/P&gt;</description>
    <pubDate>Mon, 20 Feb 2017 15:38:12 GMT</pubDate>
    <dc:creator>pradeepkumarg</dc:creator>
    <dc:date>2017-02-20T15:38:12Z</dc:date>
    <item>
      <title>How to add multi-values lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311462#M4212</link>
      <description>&lt;P&gt;My CSV is of the format :&lt;BR /&gt;
Key1 = Val11 Val12 Val13&lt;BR /&gt;
Key2 = Val21 Val22 Val23&lt;/P&gt;

&lt;P&gt;Is there any way I can use the lookup feature to gather this data in a query ? &lt;/P&gt;

&lt;P&gt;Thanks and Regards,&lt;BR /&gt;
Abhay Dandekar&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 15:10:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311462#M4212</guid>
      <dc:creator>dandekarabhay</dc:creator>
      <dc:date>2017-02-20T15:10:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to add multi-values lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311463#M4213</link>
      <description>&lt;P&gt;Could you be more specific on what you want to get in the final output? May be a sample output of what is current and what is expected?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 15:37:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311463#M4213</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-02-20T15:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to add multi-values lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311464#M4214</link>
      <description>&lt;P&gt;What do you get when you search for |inputlookup lookup_name ? How do you intend to use those results?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 15:38:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311464#M4214</guid>
      <dc:creator>pradeepkumarg</dc:creator>
      <dc:date>2017-02-20T15:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to add multi-values lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311465#M4215</link>
      <description>&lt;P&gt;sure, my lookup CSV file is something like this :&lt;BR /&gt;
view1 = tag1 tag2 tag3&lt;BR /&gt;
view2 = tag3 tag4 tag5&lt;/P&gt;

&lt;P&gt;I want to search such that, lookup for view1, should provide me with tag1 tag2 tag3, which can be used to search further. &lt;/P&gt;

&lt;P&gt;tag1,tag2 ... tag6 are the tags that I have applied via search app.&lt;/P&gt;

&lt;P&gt;Let me know if that provided enough info.&lt;/P&gt;

&lt;P&gt;Thanks and Regards,&lt;BR /&gt;
Abhay Dandekar&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 17:19:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311465#M4215</guid>
      <dc:creator>dandekarabhay</dc:creator>
      <dc:date>2017-02-20T17:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to add multi-values lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311466#M4216</link>
      <description>&lt;P&gt;Yes, that is pretty standard. A subsearch can return the lookup values in a format that allows them to be used as part of a search.&lt;/P&gt;

&lt;P&gt;Let's suppose that your lookup file lookupfoo.csv has three values (Key1 field1 field2), and that you want to give it a key value "foo1" and then do a search based on the values that are in field1 and field2.  Let's suppose this is the file.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Key1 field1 field2 
foo1 bar1   baz1
foo2 bar2   baz2
foo3 bar3   zap3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;so, this language here -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex source=* [| inputlookup lookupfoo.csv | where key1 == "foo1" | table field1 field2]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will get results that are completely the equivalent of this search -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex source=* field1="bar1" field2="baz1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For more information, see this page on the format command, which explains both what the normal format that comes back from a subsearch is, and how to change it to meet your needs.  (In your case, you don't; need to change it at all.) &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.2/Search/Changetheformatofsubsearchresults"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.2/Search/Changetheformatofsubsearchresults&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 17:55:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311466#M4216</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-02-20T17:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add multi-values lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311467#M4217</link>
      <description>&lt;P&gt;You can convert the existing csv to a properly formatted loookup file like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputcsv OriginalCSV | makemv Key1 | makemv Key2 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;At this point, you can put it into a KVStore-based lookup like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| outputlookup KVStoreCollection
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;KVStore-based lookups support &lt;CODE&gt;multivalued&lt;/CODE&gt; fields but file-based lookups do not.  If you must convert to a file-based lookup, then do it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| mvexpand Key1 | mvexpand Key2 | outputlookup FileBasedCSV
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Feb 2017 17:56:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-add-multi-values-lookups/m-p/311467#M4217</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-02-20T17:56:05Z</dc:date>
    </item>
  </channel>
</rss>

