<?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: Search query required to lookup a csv file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-query-required-to-lookup-a-csv-file/m-p/440167#M125173</link>
    <description>&lt;P&gt;You don't have to use the &lt;CODE&gt;join&lt;/CODE&gt; command. Have you tried using the query I stated above? If you add the &lt;CODE&gt;count&lt;/CODE&gt; command, you should get exactly the result you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=firewall log_subtype="vulnerability" severity="informational" | search [ inputlookup PRIVATE_IP.csv ] | stats count by src_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 01 Feb 2019 08:12:37 GMT</pubDate>
    <dc:creator>DMohn</dc:creator>
    <dc:date>2019-02-01T08:12:37Z</dc:date>
    <item>
      <title>Search query required to lookup a csv file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-query-required-to-lookup-a-csv-file/m-p/440163#M125169</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I need to check if the source address from the firewall logs is in private ip address range. How would i check using inputlookup and join commands. &lt;BR /&gt;
Below is the query i am using , however no results come up&lt;/P&gt;

&lt;P&gt;index=firewall log_subtype=vulnerability severity=informational  | join src [ inputlookup PRIVATE_IP.csv ] | stats count by src&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:02:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-query-required-to-lookup-a-csv-file/m-p/440163#M125169</guid>
      <dc:creator>ajayrejin</dc:creator>
      <dc:date>2020-09-29T23:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Search query required to lookup a csv file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-query-required-to-lookup-a-csv-file/m-p/440164#M125170</link>
      <description>&lt;P&gt;@ajayrejin,&lt;/P&gt;

&lt;P&gt;Try this and lets know if it works.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=firewall log_subtype=vulnerability severity=informational |eval flag=0
|append [inputlookup PRIVATE_IP.csv |eval flag=1]
|stats count , max(flag) as flag  by src
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If the count is &amp;gt; 1 and flag=1 then its a private IP which is part of your lookup file.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 13:40:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-query-required-to-lookup-a-csv-file/m-p/440164#M125170</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-01-31T13:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Search query required to lookup a csv file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-query-required-to-lookup-a-csv-file/m-p/440165#M125171</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You don't have to use a join here, which is a very "costly" command. A simple subsearch does the trick as well:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=firewall log_subtype=vulnerability severity=informational | search [inputlookup PRIVATE_IP.csv]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Given that the lookup table contains only one field named "src" - otherwise you will have to restrict the return from the subsearch and / or rename the field.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 13:52:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-query-required-to-lookup-a-csv-file/m-p/440165#M125171</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-01-31T13:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: Search query required to lookup a csv file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-query-required-to-lookup-a-csv-file/m-p/440166#M125172</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Thank you for that query.&lt;BR /&gt;
I am using the below query and results i see is only public IP addresses, however result should show only private IPs. Am i doin something wrong? Please do correct me&lt;/P&gt;

&lt;P&gt;index=frewall log_subtype="vulnerability" severity="informational" | join type=left src_ip [ inputlookup PRIVATE_IP.csv ] | stats count by src_ip&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:03:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-query-required-to-lookup-a-csv-file/m-p/440166#M125172</guid>
      <dc:creator>ajayrejin</dc:creator>
      <dc:date>2020-09-29T23:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Search query required to lookup a csv file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-query-required-to-lookup-a-csv-file/m-p/440167#M125173</link>
      <description>&lt;P&gt;You don't have to use the &lt;CODE&gt;join&lt;/CODE&gt; command. Have you tried using the query I stated above? If you add the &lt;CODE&gt;count&lt;/CODE&gt; command, you should get exactly the result you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=firewall log_subtype="vulnerability" severity="informational" | search [ inputlookup PRIVATE_IP.csv ] | stats count by src_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 08:12:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-query-required-to-lookup-a-csv-file/m-p/440167#M125173</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-02-01T08:12:37Z</dc:date>
    </item>
  </channel>
</rss>

