<?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 Country Name in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Country-Name/m-p/186680#M53750</link>
    <description>&lt;P&gt;What are the headers for your lookup CSV?  According to your lookup here:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="ASA" earliest=-2h | iplocation prefix=src_ip_ src_ip | lookup blacklistCountries blacklist_country as src_ip_Country OUTPUT blacklist_country_match as src_blacklist_country_match
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The format for the command is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;lookup &amp;amp;lt;lookup-table-name&amp;amp;gt; &amp;amp;lt;lookup-field1&amp;amp;gt; AS &amp;amp;lt;event-field1&amp;amp;gt;, &amp;amp;lt;lookup-field2&amp;amp;gt; AS &amp;amp;lt;event-field2&amp;amp;gt; OUTPUT &amp;amp;lt;lookup-destfield1&amp;amp;gt; AS &amp;amp;lt;event-destfield1&amp;amp;gt;, &amp;amp;lt;lookup-destfield2&amp;amp;gt; AS &amp;amp;lt;event-destfield2&amp;amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So according to this mapping, your file has this header:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;src_ip_Country,blacklist_country_match
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I suspect that this is not the case in your file.&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2015 23:30:09 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-05-13T23:30:09Z</dc:date>
    <item>
      <title>Lookup Country Name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Country-Name/m-p/186677#M53747</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I'm new to Splunk and have taken the Splunk Search/Reporting and Knowledge Objects courses - however this wasn't really part of them. I'm trying to lookup a Country name to a list of blacklisted countries. As we don't have the country names in the logs by default I need to use the iplocation command. The list itself lists the country in a field called blacklist_country and a y in the column blacklist_country_match (to show it is blacklisted). &lt;/P&gt;

&lt;P&gt;I have verified with the inputlookup command the file appears and is formatted as it should be.&lt;/P&gt;

&lt;P&gt;I know that to actually have the country names present I need to do the iplocation command - so far I have the following which displays perfectly:&lt;/P&gt;

&lt;P&gt;sourcetype="ASA" | iplocation prefix=src_ip_ src_ip | iplocation prefix=dest_ip_ dest_ip&lt;/P&gt;

&lt;P&gt;This causes the country names to show up as src_ip_Country and dest_ip_Country.&lt;/P&gt;

&lt;P&gt;However, when I do lookups to the table for matches I just get errors. Using this (just for src_ip_Country to start out with):&lt;/P&gt;

&lt;P&gt;sourcetype="ASA" earliest=-2h | iplocation prefix=src_ip_ src_ip | lookup blacklistCountries blacklist_country as src_ip_Country OUTPUT blacklist_country_match as src_blacklist_country_match&lt;/P&gt;

&lt;P&gt;I've tried adding the .csv to the end of the file name within the lookup command as well as trying OUTPUTNEW.&lt;/P&gt;

&lt;P&gt;I'd appreciate any advise on what I'm missing or even whether there is a better or more efficient way to go about this. Also, if anyone has suggestions on actually making this an auto-lookup. I assume the error has something to do with the country names not being in the logs by default and me having to call them in the same search, but I assumed that as I called them prior to the lookup it would have worked out.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:53:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Country-Name/m-p/186677#M53747</guid>
      <dc:creator>spIunk_user</dc:creator>
      <dc:date>2020-09-28T19:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Country Name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Country-Name/m-p/186678#M53748</link>
      <description>&lt;P&gt;Also this is 6.2 and everything is in my personal directory.&lt;/P&gt;</description>
      <pubDate>Tue, 12 May 2015 21:08:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Country-Name/m-p/186678#M53748</guid>
      <dc:creator>spIunk_user</dc:creator>
      <dc:date>2015-05-12T21:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Country Name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Country-Name/m-p/186679#M53749</link>
      <description>&lt;P&gt;What is in your blacklisted countries CSV file? What errors are you seeing?&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 06:36:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Country-Name/m-p/186679#M53749</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2015-05-13T06:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup Country Name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-Country-Name/m-p/186680#M53750</link>
      <description>&lt;P&gt;What are the headers for your lookup CSV?  According to your lookup here:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="ASA" earliest=-2h | iplocation prefix=src_ip_ src_ip | lookup blacklistCountries blacklist_country as src_ip_Country OUTPUT blacklist_country_match as src_blacklist_country_match
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The format for the command is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;lookup &amp;amp;lt;lookup-table-name&amp;amp;gt; &amp;amp;lt;lookup-field1&amp;amp;gt; AS &amp;amp;lt;event-field1&amp;amp;gt;, &amp;amp;lt;lookup-field2&amp;amp;gt; AS &amp;amp;lt;event-field2&amp;amp;gt; OUTPUT &amp;amp;lt;lookup-destfield1&amp;amp;gt; AS &amp;amp;lt;event-destfield1&amp;amp;gt;, &amp;amp;lt;lookup-destfield2&amp;amp;gt; AS &amp;amp;lt;event-destfield2&amp;amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So according to this mapping, your file has this header:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;src_ip_Country,blacklist_country_match
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I suspect that this is not the case in your file.&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2015 23:30:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-Country-Name/m-p/186680#M53750</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-05-13T23:30:09Z</dc:date>
    </item>
  </channel>
</rss>

