<?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: Need help with Lookup and Auto Lookup in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123704#M33396</link>
    <description>&lt;P&gt;When you fill in the form for Automatic lookup form, it asks you for both the lookup field and the event field.&lt;BR /&gt;
(lookup field on the left, event field on the right)&lt;BR /&gt;
&lt;IMG src="http://i1368.photobucket.com/albums/ag181/RxSennett/Settings___Splunk_zpsd84ca277.jpg" /&gt;&lt;/P&gt;

&lt;P&gt;You might want to look at item 6 in the doc section on the subject. Read the explanation below the image.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/SearchTutorial/Usefieldlookups#Make_the_lookup_automatic target=" other=""&gt;&lt;/A&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/SearchTutorial/Usefieldlookups#Make_the_lookup_automatic" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.1/SearchTutorial/Usefieldlookups#Make_the_lookup_automatic&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In your case, you need one additional edit that cannot be done through the GUI&lt;BR /&gt;
Depending on your permission settings, the matching &lt;CODE&gt;transforms.conf&lt;/CODE&gt; will most likely be found in $SPLUNK_HOME/etc/users/yourusername/local/trasnforms.conf&lt;/P&gt;

&lt;P&gt;Look for the definition of your lookup table "loopup"&lt;BR /&gt;
You'll see:&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[site_loopup]&lt;BR /&gt;
filename = location.csv&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You must add the line:&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
match_type = CIDR(Subnet)&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
because your lookup table uses the CIDR. Otherwise it will compare the ip address to what is basically garbage and not a match.  So, when you find the definition in transforms.conf and edit it, it will look like this:&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[site_loopup]&lt;BR /&gt;
filename = location.csv&lt;BR /&gt;
match_type = CIDR(Subnet)&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;After you make the change, run the following search:&lt;/P&gt;

&lt;P&gt;index=yourindexname sourcetype=syslog|extract reload=true&lt;/P&gt;

&lt;P&gt;You will now see the Site field in your field list.&lt;/P&gt;

&lt;P&gt;For an explanation on all the directives you can use regarding a lookup definition, check the transforms.conf.spec here&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/Admin/Transformsconf target=blah"&gt;&lt;/A&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/Admin/Transformsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.1/Admin/Transformsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;and take note of the following section:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
match_type = &lt;STRING&gt;&lt;BR /&gt;
* A comma and space-delimited list of &lt;MATCH_TYPE&gt;(&lt;FIELD_NAME&gt;) specification to allow for &lt;BR /&gt;
  non-exact matching&lt;BR /&gt;
* The available match_type values are WILDCARD, CIDR, and EXACT.  EXACT is the default and &lt;BR /&gt;
  does not need to be specified.  Only fields that should use WILDCARD or CIDR matching should &lt;BR /&gt;
  be specified in this list&lt;BR /&gt;
&lt;/FIELD_NAME&gt;&lt;/MATCH_TYPE&gt;&lt;/STRING&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 16:57:26 GMT</pubDate>
    <dc:creator>rsennett_splunk</dc:creator>
    <dc:date>2020-09-28T16:57:26Z</dc:date>
    <item>
      <title>Need help with Lookup and Auto Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123703#M33395</link>
      <description>&lt;P&gt;I do have a solution to get guest logged into our network. This gives nice logs that I get into Splunk. My goal is to have some idea on where they come from. The solution does use different sub-nets for different location&lt;/P&gt;

&lt;P&gt;So I then tried to use Lookups to convert sub-nets to site name. Its very hard to find real good example on how to use this, and when I do find some, it does not show how to use it and how to get the result to the display.&lt;/P&gt;

&lt;P&gt;Here is how the log looks like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Jun 28 08:10:08 172.30.112.1 PORTAL: 172.30.60.49 redirected to portal "Default-SMS-Portal" with rule "rul.Orlando-S"
Jun 28 08:09:18 172.30.112.1 PORTAL: Login failed for 172.30.33.63 - account 45234345 is not valid from this location.
Jun 28 08:08:18 172.30.112.1 AAA: 172.30.36.57 logged in with username 004526243545
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As you can see there is some naming, I can see Orlando in a rule, but I like a field list:&lt;BR /&gt;&lt;BR /&gt;
&lt;STRONG&gt;loc=Orlando client_ip=172.30.60.49&lt;/STRONG&gt; (client IP is extracted using &lt;STRONG&gt;Field Extractions&lt;/STRONG&gt;)&lt;/P&gt;

&lt;P&gt;Here is what I have done:&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;location.csv&lt;/STRONG&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Subnet,Site
172.30.33.0/24,Dallas
172.30.36.0/24,Washington
172.30.60.0/,Orlando
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Settings -&amp;gt; Lookups -&amp;gt; &lt;STRONG&gt;Lookup table files&lt;/STRONG&gt;:&lt;BR /&gt;&lt;BR /&gt;
New&lt;BR /&gt;&lt;BR /&gt;
Destination app: search&lt;BR /&gt;&lt;BR /&gt;
Upload a lookup file: location.csv&lt;BR /&gt;&lt;BR /&gt;
Destination filename: location.csv&lt;/P&gt;

&lt;P&gt;Settings -&amp;gt; Lookups -&amp;gt; &lt;STRONG&gt;Lookup definitions&lt;/STRONG&gt;:&lt;BR /&gt;&lt;BR /&gt;
New&lt;BR /&gt;&lt;BR /&gt;
Destination app: search&lt;BR /&gt;&lt;BR /&gt;
Name: site_lookup&lt;BR /&gt;&lt;BR /&gt;
Type: File-based&lt;BR /&gt;&lt;BR /&gt;
Lookup file: location.csv (Name I used in "Destination filename")&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;Settings -&amp;gt; Lookups -&amp;gt; &lt;STRONG&gt;Automatic lookups&lt;/STRONG&gt;:&lt;BR /&gt;&lt;BR /&gt;
New&lt;BR /&gt;&lt;BR /&gt;
Destination app: search&lt;BR /&gt;&lt;BR /&gt;
Name:auto_site_lookup&lt;BR /&gt;&lt;BR /&gt;
Lookup table: site_lookup (the one created in "Lookup definitions"&lt;BR /&gt;&lt;BR /&gt;
Apply to:&lt;BR /&gt;&lt;BR /&gt;
sourcetype syslog&lt;BR /&gt;&lt;BR /&gt;
Lookup input fields: Subnet (same as left data from CSV file)&lt;BR /&gt;&lt;BR /&gt;
Lookup output fields: Site (same as right data from CSV file)&lt;BR /&gt;&lt;BR /&gt;
I am not sure "syslog" is the correct selection, yes its syslog, but not from Cisco and is it correct data type (date format etc). I could have used host "172.30.112.1" since all data coming from it.&lt;/P&gt;

&lt;P&gt;Ok so know what???&lt;BR /&gt;&lt;BR /&gt;
I do not see any changes to my searches, no new fields, nothing converted.  How does this "Lookup" know that it should use the second IP (one I extract with "Field Extractions") and not the host IP from the log.&lt;/P&gt;

&lt;P&gt;I really like this to work.&lt;/P&gt;

&lt;P&gt;Thanks, and sorry for the long post. &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:57:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123703#M33395</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2020-09-28T16:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Lookup and Auto Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123704#M33396</link>
      <description>&lt;P&gt;When you fill in the form for Automatic lookup form, it asks you for both the lookup field and the event field.&lt;BR /&gt;
(lookup field on the left, event field on the right)&lt;BR /&gt;
&lt;IMG src="http://i1368.photobucket.com/albums/ag181/RxSennett/Settings___Splunk_zpsd84ca277.jpg" /&gt;&lt;/P&gt;

&lt;P&gt;You might want to look at item 6 in the doc section on the subject. Read the explanation below the image.&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/SearchTutorial/Usefieldlookups#Make_the_lookup_automatic target=" other=""&gt;&lt;/A&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/SearchTutorial/Usefieldlookups#Make_the_lookup_automatic" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.1/SearchTutorial/Usefieldlookups#Make_the_lookup_automatic&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In your case, you need one additional edit that cannot be done through the GUI&lt;BR /&gt;
Depending on your permission settings, the matching &lt;CODE&gt;transforms.conf&lt;/CODE&gt; will most likely be found in $SPLUNK_HOME/etc/users/yourusername/local/trasnforms.conf&lt;/P&gt;

&lt;P&gt;Look for the definition of your lookup table "loopup"&lt;BR /&gt;
You'll see:&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[site_loopup]&lt;BR /&gt;
filename = location.csv&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You must add the line:&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
match_type = CIDR(Subnet)&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
because your lookup table uses the CIDR. Otherwise it will compare the ip address to what is basically garbage and not a match.  So, when you find the definition in transforms.conf and edit it, it will look like this:&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[site_loopup]&lt;BR /&gt;
filename = location.csv&lt;BR /&gt;
match_type = CIDR(Subnet)&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;After you make the change, run the following search:&lt;/P&gt;

&lt;P&gt;index=yourindexname sourcetype=syslog|extract reload=true&lt;/P&gt;

&lt;P&gt;You will now see the Site field in your field list.&lt;/P&gt;

&lt;P&gt;For an explanation on all the directives you can use regarding a lookup definition, check the transforms.conf.spec here&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/Admin/Transformsconf target=blah"&gt;&lt;/A&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/Admin/Transformsconf" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.1/Admin/Transformsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;and take note of the following section:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
match_type = &lt;STRING&gt;&lt;BR /&gt;
* A comma and space-delimited list of &lt;MATCH_TYPE&gt;(&lt;FIELD_NAME&gt;) specification to allow for &lt;BR /&gt;
  non-exact matching&lt;BR /&gt;
* The available match_type values are WILDCARD, CIDR, and EXACT.  EXACT is the default and &lt;BR /&gt;
  does not need to be specified.  Only fields that should use WILDCARD or CIDR matching should &lt;BR /&gt;
  be specified in this list&lt;BR /&gt;
&lt;/FIELD_NAME&gt;&lt;/MATCH_TYPE&gt;&lt;/STRING&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:57:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123704#M33396</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2020-09-28T16:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Lookup and Auto Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123705#M33397</link>
      <description>&lt;P&gt;Hi, I have tried to fill inn only one side and also both side of the "Lookups field" with no changes as I can see. I am still not sure where to to see and how to see the lookups works.  Do it aromatically changes the IP subnet in the search result to names, or do I see it as fields below the log line in search.  PS I have read the tutorial you linked to, but it does only show how to set it up, not where to see it used and to see the result of the lookups &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jun 2014 07:51:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123705#M33397</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2014-06-29T07:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Lookup and Auto Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123706#M33398</link>
      <description>&lt;P&gt;you are most likely missing the directive "match_type" in your transforms.conf.&lt;BR /&gt;
You cannot add this via the GUI. See my addendum to the answer.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jun 2014 15:58:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123706#M33398</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2014-06-29T15:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Lookup and Auto Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123707#M33399</link>
      <description>&lt;P&gt;Thanks, that was missing. I do added "match_type = CIDR(Subnet)", but still not working. I did take the name "Subnet" from first field in the CSV file. Still does not get any location searching for an IP within range.  Eks: 172.30.33.24 should give Dallas.  PS stupid that this is not in the gui to change. And when I did some change in GUI, it remove the "match_type"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:58:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123707#M33399</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2020-09-28T16:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Lookup and Auto Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123708#M33400</link>
      <description>&lt;P&gt;Update.  I do see some post on splunk Answer tells me to update "$SPLUNK_HOME/etc/system/default/transforms.conf", by my file (that is created automatically when using GUI) is located in "$SPLUNK_HOME/etc/apps/search/transforms.conf".  What to use? Copy my config to the one in System? Both? or Apps?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:58:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123708#M33400</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2020-09-28T16:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with Lookup and Auto Lookup</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123709#M33401</link>
      <description>&lt;P&gt;Update2. Not helping to change any of the files.  PS fixed small type in loopup, correct lookup.  Also tried this: "host="172.30.112.1" | lookup site_lookup Subnet OUTPUT Site" found here: &lt;A href="http://answers.splunk.com/answers/57094"&gt;http://answers.splunk.com/answers/57094&lt;/A&gt;  Not helping&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jul 2014 11:33:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-Lookup-and-Auto-Lookup/m-p/123709#M33401</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2014-07-01T11:33:09Z</dc:date>
    </item>
  </channel>
</rss>

