<?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: Match IP address with IP in Lookup table and alert in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572932#M199679</link>
    <description>&lt;LI-CODE lang="markup"&gt;| makeresults count=2&lt;/LI-CODE&gt;&lt;P&gt;creates a pipeline with two events&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;counts the events in the pipeline (stream) storing the current count in the count field&lt;/P&gt;&lt;P&gt;This allows the case statements to distinguish which event is which and assign different values depending on which event it is.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Oct 2021 11:18:58 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-10-29T11:18:58Z</dc:date>
    <item>
      <title>Match IP address with IP in Lookup table and alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572611#M199578</link>
      <description>&lt;P&gt;Hello,&amp;nbsp; We are using ES and we have a lookup file downloaded which has a mix of standalone ip's and CIDRs/Subnets/.&amp;nbsp; The CSV file has 3 columns :&amp;nbsp; &lt;STRONG&gt;Description, ip, time&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;I want to match dest_ip from my search results to any of those IPs in the lookup table ( Column "ip")&amp;nbsp; and if any matches, the results&amp;nbsp; should be displayed in a table format&lt;BR /&gt;&lt;BR /&gt;I am using this search&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=2
| streamstats count
| eval src_ip = case(count=1,"1.2.3.4", count=2,"2.3.4.5")
| eval dst_ip = case(count=1 OR count=2, "1.234.65.61")
| lookup ip_reputation_list ip as dst_ip OUTPUT ip
| table _time ip&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Is the above correct?&amp;nbsp; The problem i am facing is even if no IPs match, the search results still shows me the _time column&amp;nbsp; and ip column (as empty) .&amp;nbsp; &amp;nbsp; How to get the search NOT show any results if IPs don't match in the lookup ,&amp;nbsp; and secondly can i compare IP with a CIDR in the lookup ?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="neerajs_81_0-1635327805447.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16605i4A2D36331B33B71F/image-size/large?v=v2&amp;amp;px=999" role="button" title="neerajs_81_0-1635327805447.png" alt="neerajs_81_0-1635327805447.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 09:43:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572611#M199578</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2021-10-27T09:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Match IP address with IP in Lookup table and alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572614#M199579</link>
      <description>&lt;P&gt;Does this work for the first part&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where isnotnull(ip)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 27 Oct 2021 09:52:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572614#M199579</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-27T09:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Match IP address with IP in Lookup table and alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572619#M199582</link>
      <description>&lt;P&gt;If i add&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| lookup ip_reputation_list ip as dst_ip OUTPUT ip | where isnotnull(ip)
| table _time ip&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then search results&amp;nbsp; show&amp;nbsp; "No results found" for both cases -&amp;nbsp; ip's that match the Lookup file as well as for those that do no match in the lookup file. That is weird.&amp;nbsp; &amp;nbsp;Why would it show No results found even for those that match the data in the lookup ? Is it because of a string format issue that isnotnull doesn't recognize ?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 10:04:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572619#M199582</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2021-10-27T10:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Match IP address with IP in Lookup table and alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572621#M199583</link>
      <description>&lt;P&gt;You could try&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where ip!=""&lt;/LI-CODE&gt;&lt;P&gt;Alternatively, try removing the OUTPUT ip to see if you get any fields returned by the lookup?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 10:14:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572621#M199583</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-27T10:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Match IP address with IP in Lookup table and alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572624#M199585</link>
      <description>&lt;P&gt;Thank you very much.&amp;nbsp; It turns out that both isnotnull() and ip!="" are working, i didn't realize i had mistakenly omitted streamstats just after the |makeresults count=2 command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Bit confused as in why is streamstats so important along with makeresults.&lt;BR /&gt;&lt;BR /&gt;Secondly would you know how to match an ip from the search results if its part of CIDR/Subnet in the lookup ?&amp;nbsp; We are on splunk cloud and i don't have access to transform.conf&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 10:48:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572624#M199585</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2021-10-27T10:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Match IP address with IP in Lookup table and alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572932#M199679</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults count=2&lt;/LI-CODE&gt;&lt;P&gt;creates a pipeline with two events&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| streamstats count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;counts the events in the pipeline (stream) storing the current count in the count field&lt;/P&gt;&lt;P&gt;This allows the case statements to distinguish which event is which and assign different values depending on which event it is.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 11:18:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-IP-address-with-IP-in-Lookup-table-and-alert/m-p/572932#M199679</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-29T11:18:58Z</dc:date>
    </item>
  </channel>
</rss>

