<?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 Why is my CIDR lookup search returning no results for any field from the lookup table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-CIDR-lookup-search-returning-no-results-for-any-field/m-p/131823#M35960</link>
    <description>&lt;P&gt;Hi folks... I realize every conceivable permutation of this question has already been asked and answered - I've sure looked through them all, but I just can't seem to get CIDR match in a lookup to work.&lt;/P&gt;

&lt;P&gt;Use case: huge LAN address space with upwards of 800 subnets, managed by multiple frontline IT teams. Need a way of pinning down the subnet for a host so delegation of issues becomes more straightforward than a manual IPAM search.&lt;/P&gt;

&lt;P&gt;I have a  lookup csv, &lt;CODE&gt;VLAN_Lookup.csv&lt;/CODE&gt;, sitting in &lt;CODE&gt;$SPLUNK_HOME/etc/apps/search/lookups&lt;/CODE&gt;. Format is,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Subnet,Site_ID,Department_ID,Building_ID,VLAN_Name,Utilisation
123.234.0.0/24,Sxyz,Dxyz,Bxyz,Name_of_VLAN_X,wx.yz%
...
 /* The "Utilisation" field is important to us because we're forever running out of addresses */
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The current stanza in &lt;CODE&gt;transforms.conf&lt;/CODE&gt; (I've tried a couple of others, all with the same outcome) is,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[VLAN_Lookup]
filename = VLAN_Lookup.csv
match_type = CIDR(Subnet)
max_matches = 1
fields_list = Subnet,Site_ID,Department_ID,Building_ID,VLAN_Name,Utilisation
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Running &lt;CODE&gt;| inputlookup VLAN_Lookup | table Subnet Site_ID Department_ID Building_ID VLAN_Name Utilisation&lt;/CODE&gt; in Splunkweb pulls the information out of the csv file without a problem (indicating the lookup definition is fine), but trying to run a search like&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=blah client_ip=* | lookup VLAN_Lookup Subnet AS client_ip OUTPUT VLAN_Name AS VLAN_Name&lt;BR /&gt;
 | table client_ip VLAN_Name&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;results in the &lt;CODE&gt;VLAN_Name&lt;/CODE&gt; - or whatever other field from the lookup table I pick always coming up blank.&lt;/P&gt;

&lt;P&gt;What am I missing? &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Apr 2015 05:05:14 GMT</pubDate>
    <dc:creator>malat_UoM</dc:creator>
    <dc:date>2015-04-09T05:05:14Z</dc:date>
    <item>
      <title>Why is my CIDR lookup search returning no results for any field from the lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-CIDR-lookup-search-returning-no-results-for-any-field/m-p/131823#M35960</link>
      <description>&lt;P&gt;Hi folks... I realize every conceivable permutation of this question has already been asked and answered - I've sure looked through them all, but I just can't seem to get CIDR match in a lookup to work.&lt;/P&gt;

&lt;P&gt;Use case: huge LAN address space with upwards of 800 subnets, managed by multiple frontline IT teams. Need a way of pinning down the subnet for a host so delegation of issues becomes more straightforward than a manual IPAM search.&lt;/P&gt;

&lt;P&gt;I have a  lookup csv, &lt;CODE&gt;VLAN_Lookup.csv&lt;/CODE&gt;, sitting in &lt;CODE&gt;$SPLUNK_HOME/etc/apps/search/lookups&lt;/CODE&gt;. Format is,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Subnet,Site_ID,Department_ID,Building_ID,VLAN_Name,Utilisation
123.234.0.0/24,Sxyz,Dxyz,Bxyz,Name_of_VLAN_X,wx.yz%
...
 /* The "Utilisation" field is important to us because we're forever running out of addresses */
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The current stanza in &lt;CODE&gt;transforms.conf&lt;/CODE&gt; (I've tried a couple of others, all with the same outcome) is,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[VLAN_Lookup]
filename = VLAN_Lookup.csv
match_type = CIDR(Subnet)
max_matches = 1
fields_list = Subnet,Site_ID,Department_ID,Building_ID,VLAN_Name,Utilisation
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Running &lt;CODE&gt;| inputlookup VLAN_Lookup | table Subnet Site_ID Department_ID Building_ID VLAN_Name Utilisation&lt;/CODE&gt; in Splunkweb pulls the information out of the csv file without a problem (indicating the lookup definition is fine), but trying to run a search like&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=blah client_ip=* | lookup VLAN_Lookup Subnet AS client_ip OUTPUT VLAN_Name AS VLAN_Name&lt;BR /&gt;
 | table client_ip VLAN_Name&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;results in the &lt;CODE&gt;VLAN_Name&lt;/CODE&gt; - or whatever other field from the lookup table I pick always coming up blank.&lt;/P&gt;

&lt;P&gt;What am I missing? &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2015 05:05:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-CIDR-lookup-search-returning-no-results-for-any-field/m-p/131823#M35960</guid>
      <dc:creator>malat_UoM</dc:creator>
      <dc:date>2015-04-09T05:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Why is my CIDR lookup search returning no results for any field from the lookup table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-CIDR-lookup-search-returning-no-results-for-any-field/m-p/131824#M35961</link>
      <description>&lt;P&gt;OK; false alarm, sort of... turns out "If at first you don't succeed, try, try again" applied to Splunk restarts in this eventuality.&lt;/P&gt;

&lt;P&gt;(we run a distributed environment, with two search heads, and a common set of config files in a mounted remote directory; both search heads had to be restarted for the changes in transforms.conf to get picked up, rather than just the one I was running searches on...)&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2015 07:01:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-CIDR-lookup-search-returning-no-results-for-any-field/m-p/131824#M35961</guid>
      <dc:creator>malat_UoM</dc:creator>
      <dc:date>2015-04-13T07:01:28Z</dc:date>
    </item>
  </channel>
</rss>

