<?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: Lookup issues in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-issues/m-p/23546#M4215</link>
    <description>&lt;P&gt;I think I'm missing something "the field name"&lt;/P&gt;

&lt;P&gt;The sanslist.csv is only a list of IP's there is no field name in the one column table. Who do I get the field name in the table or lookup.&lt;/P&gt;

&lt;P&gt;I am doing a rex piped to a table command to get the IP from a scripted downloaded file and then pipe the table to "outputlookup sanslist.csv"  How do I get the field name into this?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Nov 2011 15:22:11 GMT</pubDate>
    <dc:creator>hartfoml</dc:creator>
    <dc:date>2011-11-29T15:22:11Z</dc:date>
    <item>
      <title>Lookup issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-issues/m-p/23544#M4213</link>
      <description>&lt;P&gt;I have a table of bad IP's that I want to use in a search agnest my firewall logs&lt;/P&gt;

&lt;P&gt;in the past I have done this low tech search &lt;/P&gt;

&lt;P&gt;sourcetype="cisco_syslog" ("x.x.x.x" OR "y.y.y.y" OR z.z.z.z) # this sometimes takes a long time #&lt;/P&gt;

&lt;P&gt;this search would find all the firewall logs that have any of the bad IP's.  As the list became longer I wanted to use the list from SANS.org.  I can automaticly generate the list OK, but how do I use the list in a search?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 21:01:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-issues/m-p/23544#M4213</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2011-11-28T21:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-issues/m-p/23545#M4214</link>
      <description>&lt;P&gt;Create a lookup file and put it for instance in an appropriate directory (for instance &lt;CODE&gt;$SPLUNK_HOME/etc/system/lookups&lt;/CODE&gt;), then search for IP numbers found in it using a subsearch. Let's say you call the lookup &lt;CODE&gt;sanslist.csv&lt;/CODE&gt; and use the field name "ip":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="cisco_syslog" [| inputlookup sanslist.csv | rename ip AS query | fields query]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Some information on the reason for renaming the "ip" field to "query": a subsearch works much like backticks in many *NIX shells, in that it executes first of all and then returns its results to the outer search, which uses this output. Normally if you have a subsearch with "&lt;CODE&gt;| fields foo&lt;/CODE&gt;" at the end, the subsearch will return something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;((foo="val1") OR (foo="val2") OR (foo="val3") ... OR foo="val42"))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;query&lt;/CODE&gt; is a special field that causes the subsearch to return pure free-text searches rather than searching for values in a particular field. So if &lt;CODE&gt;foo&lt;/CODE&gt; were to be renamed to &lt;CODE&gt;query&lt;/CODE&gt;, the subsearch would instead return something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;("val1" OR "val2" OR "val3" ... OR "val42")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In your case you want to search for the IP numbers as free-text searches, so that's why the renaming is needed.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2011 21:22:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-issues/m-p/23545#M4214</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-11-28T21:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-issues/m-p/23546#M4215</link>
      <description>&lt;P&gt;I think I'm missing something "the field name"&lt;/P&gt;

&lt;P&gt;The sanslist.csv is only a list of IP's there is no field name in the one column table. Who do I get the field name in the table or lookup.&lt;/P&gt;

&lt;P&gt;I am doing a rex piped to a table command to get the IP from a scripted downloaded file and then pipe the table to "outputlookup sanslist.csv"  How do I get the field name into this?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2011 15:22:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-issues/m-p/23546#M4215</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2011-11-29T15:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup issues</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-issues/m-p/23547#M4216</link>
      <description>&lt;P&gt;If you are passing values to outputlookup you are feeding it with some field value as well. Have a look at this question: &lt;A href="http://splunk-base.splunk.com/answers/5521/specify-fields-for-outputlookup-or-outputcsv"&gt;http://splunk-base.splunk.com/answers/5521/specify-fields-for-outputlookup-or-outputcsv&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Or check yourself in the resulting .csv file. The fieldname is in the headers on the first line of the CSV file.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2011 15:55:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-issues/m-p/23547#M4216</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-11-29T15:55:14Z</dc:date>
    </item>
  </channel>
</rss>

