<?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 Lookup: local_ip{ having fields threat_key, CIDR range, description}. I want to match ip from index=* to the column CIDR range of lookup where threat_key=&amp;quot;abc&amp;quot;. How we can do that in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-local-ip-having-fields-threat-key-CIDR-range-description/m-p/425456#M95846</link>
    <description>&lt;P&gt;Lookup: local_ip{ having fields threat_key, CIDR range, description}. I want to match ip from index=* to the column CIDR range of lookup where threat_key="abc". How we can do that&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 22:18:41 GMT</pubDate>
    <dc:creator>shaif95</dc:creator>
    <dc:date>2020-09-29T22:18:41Z</dc:date>
    <item>
      <title>Lookup: local_ip{ having fields threat_key, CIDR range, description}. I want to match ip from index=* to the column CIDR range of lookup where threat_key="abc". How we can do that</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-local-ip-having-fields-threat-key-CIDR-range-description/m-p/425456#M95846</link>
      <description>&lt;P&gt;Lookup: local_ip{ having fields threat_key, CIDR range, description}. I want to match ip from index=* to the column CIDR range of lookup where threat_key="abc". How we can do that&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:18:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-local-ip-having-fields-threat-key-CIDR-range-description/m-p/425456#M95846</guid>
      <dc:creator>shaif95</dc:creator>
      <dc:date>2020-09-29T22:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup: local_ip{ having fields threat_key, CIDR range, description}. I want to match ip from index=* to the column CIDR range of lookup where threat_key="abc". How we can do that</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-local-ip-having-fields-threat-key-CIDR-range-description/m-p/425457#M95847</link>
      <description>&lt;P&gt;Hi! If I understand correctly, your lookup file (let's name it threats.csv) looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;threat_key,cidr_range,description
abc,192.168.0.0/24,Threat A
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;First, you need to create a lookup definition. Go into Settings / Lookups / Lookup definitions. Create a new one and name it "threats_lookup". Select "File-based" and "threats.csv". Very important: Click on "Advanced options" and under "Match type" enter: CIDR(cidr_range).&lt;/P&gt;

&lt;P&gt;Now you should be able to run your search as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* ... | table local_ip,...
| eval threat_key="abc"
| lookup threats_lookup threat_key cidr_range AS local_ip OUTPUT description
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:18:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-local-ip-having-fields-threat-key-CIDR-range-description/m-p/425457#M95847</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2020-09-29T22:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup: local_ip{ having fields threat_key, CIDR range, description}. I want to match ip from index=* to the column CIDR range of lookup where threat_key="abc". How we can do that</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-local-ip-having-fields-threat-key-CIDR-range-description/m-p/425458#M95848</link>
      <description>&lt;P&gt;Here threat_key need to be check in lookup table itself. Like threat_key coloumns can have many values such as &lt;BR /&gt;
abc&lt;BR /&gt;
xyz&lt;BR /&gt;
but for the abc values only how can I compare from lookup.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:18:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-local-ip-having-fields-threat-key-CIDR-range-description/m-p/425458#M95848</guid>
      <dc:creator>shaif95</dc:creator>
      <dc:date>2020-09-29T22:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup: local_ip{ having fields threat_key, CIDR range, description}. I want to match ip from index=* to the column CIDR range of lookup where threat_key="abc". How we can do that</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Lookup-local-ip-having-fields-threat-key-CIDR-range-description/m-p/425459#M95849</link>
      <description>&lt;P&gt;So when you run your base seach (index=...) you get events which have both the local_ip field as well as the threat_key field. The threat_key field can have different values and only for threat_key="abc" you want to do the lookup. Do I understand correctly?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:22:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Lookup-local-ip-having-fields-threat-key-CIDR-range-description/m-p/425459#M95849</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2020-09-29T22:22:02Z</dc:date>
    </item>
  </channel>
</rss>

