<?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 search from a lookup table and match when part of a string from an events' field matches a value in a lookup table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424830#M121819</link>
    <description>&lt;P&gt;True, you dont have to add the domain_match field. You could change the lookup command as @starcher suggested. Just a preference of mine&lt;/P&gt;</description>
    <pubDate>Wed, 06 Mar 2019 22:03:52 GMT</pubDate>
    <dc:creator>pkeenan87</dc:creator>
    <dc:date>2019-03-06T22:03:52Z</dc:date>
    <item>
      <title>How do I search from a lookup table and match when part of a string from an events' field matches a value in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424826#M121815</link>
      <description>&lt;P&gt;Hi all, &lt;/P&gt;

&lt;P&gt;I know many questions exist similar to this one but none are useful for my particular use case. Please if somebody could advise me on how to do this,  I'd appreciate it!&lt;/P&gt;

&lt;P&gt;I have a lookup table(mytable) that looks like this. (note, I can add or remove the asterisk easily - i'm just unsure if it'll be useful or not later on&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;domains
*domain.com
*someotherdomain.com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I created the following search but I'm not getting expected result, likely because I'm searching for exact matches rather than partial. (a &lt;CODE&gt;queried_domain&lt;/CODE&gt; value might look like &lt;CODE&gt;queried_domain=example.domain.com&lt;/CODE&gt;) which explains why I tried using asterisk as a wildcard.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search 
| lookup mytable domains AS queried_domain OUTPUT domains 
| search domains=* 
| sort -_time 
| table _time request_ip queried_domain
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anyone please tell me how I'd go about doing this? &lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 20:50:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424826#M121815</guid>
      <dc:creator>nickcardenas</dc:creator>
      <dc:date>2019-03-06T20:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I search from a lookup table and match when part of a string from an events' field matches a value in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424827#M121816</link>
      <description>&lt;P&gt;You will need to create a lookup with the wildcard match type. &lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mytable]
filename = mytable.csv
match_type = WILDCARD(domains)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;mytable.csv&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;domains
*domain.com
*someotherdomain.com
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then use this in your search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search 
| lookup mytable domains as queried_domain OUTPUTNEW domains as domain_match
| where isnotnull(domain_match)
| sort -_time 
| table _time request_ip queried_domain
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Mar 2019 21:09:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424827#M121816</guid>
      <dc:creator>pkeenan87</dc:creator>
      <dc:date>2019-03-06T21:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I search from a lookup table and match when part of a string from an events' field matches a value in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424828#M121817</link>
      <description>&lt;P&gt;Could you see any other implementation without changing the columns of the lookup? It's generated by a dashboard not owned by me (where a user inputs just a domain and it's added into that lookup). &lt;/P&gt;

&lt;P&gt;Also,  would you mind explaining how &lt;CODE&gt;|where isnotnull(domain_match)&lt;/CODE&gt; would return events from the base search that would match when a csv value partially matches a field from those events? &lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 21:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424828#M121817</guid>
      <dc:creator>nickcardenas</dc:creator>
      <dc:date>2019-03-06T21:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I search from a lookup table and match when part of a string from an events' field matches a value in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424829#M121818</link>
      <description>&lt;P&gt;dont add domain_match. Instead&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | lookup mytable domains as queried_domain OUTPUTNEW domains as domain_match
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Mar 2019 21:51:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424829#M121818</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2019-03-06T21:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I search from a lookup table and match when part of a string from an events' field matches a value in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424830#M121819</link>
      <description>&lt;P&gt;True, you dont have to add the domain_match field. You could change the lookup command as @starcher suggested. Just a preference of mine&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2019 22:03:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424830#M121819</guid>
      <dc:creator>pkeenan87</dc:creator>
      <dc:date>2019-03-06T22:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I search from a lookup table and match when part of a string from an events' field matches a value in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424831#M121820</link>
      <description>&lt;P&gt;First of all, he is not asking you to change the lookup.  Second, you told us that if necessary, changing it would not be a problem: &lt;CODE&gt;I can add or remove the asterisk easily&lt;/CODE&gt;.  What he is telling you to do is to create a &lt;CODE&gt;Lookup definition&lt;/CODE&gt; that points to the &lt;EM&gt;#existing, unmodified#&lt;/EM&gt;&lt;CODE&gt;Lookup file&lt;/CODE&gt; and then referencing the &lt;CODE&gt;Lookup file&lt;/CODE&gt; &lt;EM&gt;#through#&lt;/EM&gt; the &lt;CODE&gt;Lookup definition&lt;/CODE&gt; which qualifies how the &lt;CODE&gt;lookup&lt;/CODE&gt; will behave.  You can have multiple &lt;CODE&gt;Lookup definitions&lt;/CODE&gt; with different configurations pointing to the same &lt;CODE&gt;Lookup file&lt;/CODE&gt;.  So if there is already a &lt;CODE&gt;Lookup definition&lt;/CODE&gt; called &lt;CODE&gt;mytable&lt;/CODE&gt;, then create a new one called &lt;CODE&gt;mytable2&lt;/CODE&gt; and use the new one.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 05:18:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424831#M121820</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-03-07T05:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I search from a lookup table and match when part of a string from an events' field matches a value in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424832#M121821</link>
      <description>&lt;P&gt;Ohhhh okay, now I'm following.. Thank you for clarifying! &lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 13:29:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424832#M121821</guid>
      <dc:creator>nickcardenas</dc:creator>
      <dc:date>2019-03-08T13:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I search from a lookup table and match when part of a string from an events' field matches a value in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424833#M121822</link>
      <description>&lt;P&gt;For those who stumble on to this question, this solution ended up working as expected:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search
    [| inputlookup mytable 
    | rename domains AS queried_domain ] 
| sort -_time 
| table _time request_ip queried_domain
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Knowing when to use inputlookup and lookup was the confusion here.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 20:33:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424833#M121822</guid>
      <dc:creator>nickcardenas</dc:creator>
      <dc:date>2019-03-08T20:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I search from a lookup table and match when part of a string from an events' field matches a value in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424834#M121823</link>
      <description>&lt;P&gt;Right, it's always good to have a reference to this masterpiece answer by @acharlieh at &lt;A href="https://answers.splunk.com/answers/390349/what-is-the-basic-difference-between-the-lookup-in.html"&gt;What is the basic difference between the lookup, inputlook and outputlookup commands&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2019 21:00:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424834#M121823</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2019-03-08T21:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I search from a lookup table and match when part of a string from an events' field matches a value in a lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424835#M121824</link>
      <description>&lt;P&gt;This helped clarify a lot! Thank you for linking that!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 12:12:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-search-from-a-lookup-table-and-match-when-part-of-a/m-p/424835#M121824</guid>
      <dc:creator>nickcardenas</dc:creator>
      <dc:date>2019-03-11T12:12:05Z</dc:date>
    </item>
  </channel>
</rss>

