<?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: Automatic Lookup matching on multiple fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Automatic-Lookup-matching-on-multiple-fields/m-p/308483#M92526</link>
    <description>&lt;P&gt;what do you mean it isn't functioning?  can you share the automatic lookup definition in props.conf?&lt;/P&gt;

&lt;P&gt;also, why not have "*" in the lookup for signature when it doesn't matter, as opposed to not being there at all?  If it should match any sig for that reason/status, then * might make more sense - you already have it defined as a wildcard match.&lt;/P&gt;</description>
    <pubDate>Sat, 27 Jan 2018 16:06:54 GMT</pubDate>
    <dc:creator>maciep</dc:creator>
    <dc:date>2018-01-27T16:06:54Z</dc:date>
    <item>
      <title>Automatic Lookup matching on multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Automatic-Lookup-matching-on-multiple-fields/m-p/308482#M92525</link>
      <description>&lt;P&gt;I'm attempting to create an automatic lookup that matches src_ip, dest_ip, and signature in returns a "reason" and "status" field. The events always contain src_ip, dest_ip, and signature. In the lookup table, we may have src_ip, dest_ip, and/or signature but not all three are required.&lt;/P&gt;

&lt;P&gt;Example lookup "whitelist.csv"&lt;BR /&gt;
dest_ip,src_ip,signature,reason,status&lt;BR /&gt;
8.8.8.8/32,0.0.0.0/0,456789,False Positive,Y&lt;BR /&gt;
0.0.0.0/0,128.72.21.3,987654,Deemed Safe,Y&lt;BR /&gt;
128.72.56.48,128.72.110.0/24,,Permitted,Y&lt;/P&gt;

&lt;P&gt;I've already performed match typing in transforms.conf (see below)&lt;BR /&gt;
[whitelist]&lt;BR /&gt;
filename = whitelist.csv&lt;BR /&gt;
match_type = CIDR(src_ip)&lt;BR /&gt;
match_type = CIDR(dest_ip)&lt;BR /&gt;
match_type = WILDCARD(signature)&lt;/P&gt;

&lt;P&gt;What I need to happen is for the automatic lookup to match the "reason" and "status" fields based on the combination of src_ip, dest_ip, and signature (note: I'm using the CIDR notation 0.0.0.0/0 to indicate all IPs when the source or destination doesn't matter accordingly). I thought this solution would work but the automatic lookup just isn't functioning.&lt;/P&gt;

&lt;P&gt;Any assistance provided is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:40:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Automatic-Lookup-matching-on-multiple-fields/m-p/308482#M92525</guid>
      <dc:creator>chillsgrove</dc:creator>
      <dc:date>2020-09-29T17:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Lookup matching on multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Automatic-Lookup-matching-on-multiple-fields/m-p/308483#M92526</link>
      <description>&lt;P&gt;what do you mean it isn't functioning?  can you share the automatic lookup definition in props.conf?&lt;/P&gt;

&lt;P&gt;also, why not have "*" in the lookup for signature when it doesn't matter, as opposed to not being there at all?  If it should match any sig for that reason/status, then * might make more sense - you already have it defined as a wildcard match.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jan 2018 16:06:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Automatic-Lookup-matching-on-multiple-fields/m-p/308483#M92526</guid>
      <dc:creator>maciep</dc:creator>
      <dc:date>2018-01-27T16:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Lookup matching on multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Automatic-Lookup-matching-on-multiple-fields/m-p/308484#M92527</link>
      <description>&lt;P&gt;The first problem is your transforms.conf is incorrect. Each key in a stanza is unique, and if you set a key multiple times in a stanza the last one wins. Assuming if you took your transforms and put it into the local search app, you can use &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.1/Troubleshooting/Usebtooltotroubleshootconfigurations" target="_blank"&gt;btool&lt;/A&gt; and see this to be the case: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ ./bin/splunk btool transforms list whitelist --debug | grep -v system/default
./etc/apps/search/local/transforms.conf [whitelist]
./etc/apps/search/local/transforms.conf filename = whitelist.csv
./etc/apps/search/local/transforms.conf match_type = WILDCARD(signature)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Therefore only the WILDCARD on signature is taking effect. Turning and looking at the spec file in the docs we see match_type is a comma and space separated list so we can correct your transforms stanza like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[whitelist]
filename = whitelist.csv
match_type = CIDR(src_ip), CIDR(dest_ip), WILDCARD(signature)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After a restart/reload, we have the first problem fixed... and now we need to talk about the data in your example lookup... If you're using CIDR matching, fields must be in CIDR notation... (src_ip on the Deemed Safe row, and dest_ip on the Permitted row are both missing a &lt;CODE&gt;/32&lt;/CODE&gt; making them not CIDR fields, and thus fail to match). &lt;/P&gt;

&lt;P&gt;Regarding the Permitted line.... If the intention on the was to match all signature values, the field needs to be a &lt;CODE&gt;*&lt;/CODE&gt; and not a blank value. &lt;/P&gt;

&lt;P&gt;With both the data and your definitions corrected, you should now able to verify the lookup is working correctly against sample data using the &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/lookup" target="_blank"&gt;lookup&lt;/A&gt; command. Using as clauses in the OUTPUT part you can even see which row matched each value:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;base search&amp;gt; | lookup whitelist src_ip dest_ip signature OUTPUT src_ip AS lookup_src_ip dest_ip AS lookup_dest_ip signature as lookup_signature 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After this, then to make the lookup automatic, you'd have to &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.0.1/Knowledge/DefineanautomaticlookupinSplunkWeb" target="_blank"&gt;follow the docs&lt;/A&gt; to build it... or make the correct props.conf settings and restart/reload.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:48:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Automatic-Lookup-matching-on-multiple-fields/m-p/308484#M92527</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2020-09-29T17:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic Lookup matching on multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Automatic-Lookup-matching-on-multiple-fields/m-p/308485#M92528</link>
      <description>&lt;P&gt;Thank you. This worked perfectly.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 03:52:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Automatic-Lookup-matching-on-multiple-fields/m-p/308485#M92528</guid>
      <dc:creator>chillsgrove</dc:creator>
      <dc:date>2018-02-06T03:52:03Z</dc:date>
    </item>
  </channel>
</rss>

