<?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: adding fallback (&amp;quot;others&amp;quot;) to a lookup table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27765#M5429</link>
    <description>&lt;P&gt;All the solutions work fine - thanks a lot!&lt;BR /&gt;
This one (subjectively) is the most versatile one - but thanks a lot to everyone for helping &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;It's a shame more than one answer cannot be marked as the right one...&lt;/P&gt;</description>
    <pubDate>Fri, 09 Dec 2011 12:55:46 GMT</pubDate>
    <dc:creator>wsw70</dc:creator>
    <dc:date>2011-12-09T12:55:46Z</dc:date>
    <item>
      <title>adding fallback ("others") to a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27760#M5424</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Following up on &lt;A href="http://splunk-base.splunk.com/answers/35434/adding-a-field-based-on-other-fields"&gt;the excellent answer to my question about (essentially) using a lookup table&lt;/A&gt;, I wonder how to deal with events not referenced in the lookup table. Namely I have a lookup table&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;product,vendor
MS,Microsoft
Microsoft,Microsoft
Adobe,Adobe
Flash,Adobe
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works fine, but the only events available after a lookup are the ones which match the lookup table. This means that the other ones are discarded -- I would like to keep them, though, and assign them to a vendor "other" (a fallback category, so to speak). Essentially I would be looking for a lookup table like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;product,vendor
MS,Microsoft
Microsoft,Microsoft
Adobe,Adobe
Flash,Adobe
*,others
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I know that this is not the correct way to build the table, I just wanted to give an idea about the sought result &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
I use this lookup directly from the search field (as of now).&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2011 15:15:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27760#M5424</guid>
      <dc:creator>wsw70</dc:creator>
      <dc:date>2011-12-02T15:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: adding fallback ("others") to a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27761#M5425</link>
      <description>&lt;P&gt;One approach is to use an &lt;CODE&gt;eval&lt;/CODE&gt; to fix it after the fact.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval vendor=coalesce(vendor,"others")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Dec 2011 15:48:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27761#M5425</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2011-12-02T15:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: adding fallback ("others") to a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27762#M5426</link>
      <description>&lt;P&gt;Thank you! This does the trick&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2011 16:17:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27762#M5426</guid>
      <dc:creator>wsw70</dc:creator>
      <dc:date>2011-12-02T16:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: adding fallback ("others") to a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27763#M5427</link>
      <description>&lt;P&gt;I've been using the default matches section of the lookup for that. If something doesn't exist in my lookup table it takes the defaults.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2011 16:34:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27763#M5427</guid>
      <dc:creator>MickSheppard</dc:creator>
      <dc:date>2011-12-02T16:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: adding fallback ("others") to a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27764#M5428</link>
      <description>&lt;P&gt;Another approach (in addition to &lt;CODE&gt;default_match&lt;/CODE&gt; as mentioned by MickSheppard, and in addition to evaluating afterwards) is tospecify in your lookup defintion that a certain field is matched using wildcards. In transforms.conf in the lookup table definition:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mylookuptablename]
filename=mylookupfile.csv
match_type=WILDCARD(product)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will then let your above CSV match using the "*" wildcard. (Partial wildcard matches are also possible.)&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2011 16:45:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27764#M5428</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-12-02T16:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: adding fallback ("others") to a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27765#M5429</link>
      <description>&lt;P&gt;All the solutions work fine - thanks a lot!&lt;BR /&gt;
This one (subjectively) is the most versatile one - but thanks a lot to everyone for helping &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;It's a shame more than one answer cannot be marked as the right one...&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2011 12:55:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27765#M5429</guid>
      <dc:creator>wsw70</dc:creator>
      <dc:date>2011-12-09T12:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: adding fallback ("others") to a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27766#M5430</link>
      <description>&lt;P&gt;One final question: what do you mean by "Partial wildcard matches are also possible"?&lt;/P&gt;

&lt;P&gt;The * wilcard on its own works fine.&lt;BR /&gt;
I tried * Java * to catch both "Oracle Java something" and "Sun Java something" but the match does not work&lt;BR /&gt;
(there is no space between the stars and the word Java, otherwise the comment system interprets this as "Java in italics")&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2011 13:56:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/adding-fallback-quot-others-quot-to-a-lookup-table/m-p/27766#M5430</guid>
      <dc:creator>wsw70</dc:creator>
      <dc:date>2011-12-09T13:56:41Z</dc:date>
    </item>
  </channel>
</rss>

