<?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 Using the results of a query , and search it in a lookup table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-the-results-of-a-query-and-search-it-in-a-lookup-table/m-p/174433#M50054</link>
    <description>&lt;P&gt;I have a query which looks at FTP  attacks, and the resulting field is called "IP", now i want to search the results for the IP field in a lookup table and return if the IP is present in the lookup table.&lt;/P&gt;

&lt;P&gt;I know we can use Sub search, but I'm not sure how to integrate  both. Using eval in a lookup query.&lt;/P&gt;</description>
    <pubDate>Thu, 07 May 2015 16:36:00 GMT</pubDate>
    <dc:creator>Kishorebk</dc:creator>
    <dc:date>2015-05-07T16:36:00Z</dc:date>
    <item>
      <title>Using the results of a query , and search it in a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-the-results-of-a-query-and-search-it-in-a-lookup-table/m-p/174433#M50054</link>
      <description>&lt;P&gt;I have a query which looks at FTP  attacks, and the resulting field is called "IP", now i want to search the results for the IP field in a lookup table and return if the IP is present in the lookup table.&lt;/P&gt;

&lt;P&gt;I know we can use Sub search, but I'm not sure how to integrate  both. Using eval in a lookup query.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2015 16:36:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-the-results-of-a-query-and-search-it-in-a-lookup-table/m-p/174433#M50054</guid>
      <dc:creator>Kishorebk</dc:creator>
      <dc:date>2015-05-07T16:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using the results of a query , and search it in a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-the-results-of-a-query-and-search-it-in-a-lookup-table/m-p/174434#M50055</link>
      <description>&lt;P&gt;Try using a &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/Join"&gt;join&lt;/A&gt;,&lt;/P&gt;

&lt;P&gt;| join IP [|inputlookup ip_.csv]&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2015 16:59:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-the-results-of-a-query-and-search-it-in-a-lookup-table/m-p/174434#M50055</guid>
      <dc:creator>dolivasoh</dc:creator>
      <dc:date>2015-05-07T16:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using the results of a query , and search it in a lookup table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-the-results-of-a-query-and-search-it-in-a-lookup-table/m-p/174435#M50056</link>
      <description>&lt;P&gt;Thanks dolivasoh. &lt;/P&gt;

&lt;P&gt;I tried but it doesn't seem to work. &lt;/P&gt;

&lt;P&gt;I giving you the query&lt;/P&gt;

&lt;P&gt;index=* ("WARNING: DNS " OR "password authentication failed." OR "Authentication failed" OR "Login successful" ) OR (Message="There is no such user" OR "Failed to sign on: This IP address has been locked out.") OR ("Invalid login credentials;" XXX_ftp_ip!=xxx.* _raw!="&lt;EM&gt;Connection denied from&lt;/EM&gt;") | rename XXX_dest_IP as dest | rex "failed\D\s+Login\s+to\s+account\s+(?&amp;lt;Bruteforceuser&amp;gt;\w*)" | rename Username as Bruteforceuser | rename XXX_user as Bruteforceuser | rex "for\s+user\s+(?&amp;lt;Bruteforceuser&amp;gt;[^,]+)" | rex ""."com\s+"("+(?&amp;lt;Accept_IP&amp;gt;\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})" | rex "-\sConnection\sdenied\sfrom\sIP\saddress\s(?&amp;lt;Bruteforce_IP&amp;gt;\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})" | rex "IPAddress=+(?&amp;lt;Bruteforce_IP&amp;gt;\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})" | rex "coming\sfrom\s(?&amp;lt;Bruteforce_IP&amp;gt;\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})" | iplocation Bruteforce_IP | iplocation Accept_IP | search Accept_IP!="xx.xxx*" AND Accept_IP!="xxx.xxx*" AND Accept_IP!="xx.xx*" AND Accept_IP!="xxx.xxx*" | eval status=if(Bruteforce_IP=Accept_IP, "ACCEPTED", "DENIED") | rename Accept_IP as IP | rename Bruteforce_IP as IP | stats count values(host) as dest, dc(Bruteforceuser) as bruteuser_count, values(Bruteforceuser) as Brute_userid values(index) as index by IP, Country, status | fields index, IP, count, Country, status, dest,bruteuser_count,Brute_userid | sort - count &lt;/P&gt;

&lt;P&gt;Now I want to use the field "IP" to search in the lookup table "Newbadlist" which has a field BadIp. And use eval to search if IP was seen in the lookup and if so , i should see the output under a field as "badIP" or "not badIP".&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:58:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-the-results-of-a-query-and-search-it-in-a-lookup-table/m-p/174435#M50056</guid>
      <dc:creator>Kishorebk</dc:creator>
      <dc:date>2020-09-28T19:58:43Z</dc:date>
    </item>
  </channel>
</rss>

