<?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 search help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/595309#M207179</link>
    <description>&lt;P&gt;So, this search returns NO events?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=wineventlog OR index=fortigate src_ip=100.14.174.187&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;or after you add&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| lookup TORIP TORIP AS src_ip OUTPUT TORIP
| search TORIP=*&lt;/LI-CODE&gt;&lt;P&gt;you get no results?&lt;/P&gt;&lt;P&gt;If after the initial phase, then there is no event with a field src_ip as that value, either because it does not exist, or src_ip is not a valid field with that value.&lt;/P&gt;&lt;P&gt;If after the second, there is an issue with the lookup.&lt;/P&gt;&lt;P&gt;The reason the second is returning all IPs is because that evaluated search looks like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=wineventlog OR index=fortigate (src_ip="IP_1") OR (src_ip="IP_2") OR ...&lt;/LI-CODE&gt;&lt;P&gt;which means that you will get ANY event from index=wineventlog OR ANY event from index=fortigate WHERE src_ip matches the set of IPs. - Brackets needed round the index statements.&lt;/P&gt;&lt;P&gt;I assume this statement works and returns all IPs in the lookup file?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup TORIP
| search TORIP=*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Apr 2022 23:50:44 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2022-04-25T23:50:44Z</dc:date>
    <item>
      <title>Why is my Lookup search not returning results correctly?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594335#M206856</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am having trouble with a search that is not returning results as it should. The search is below and I have attached an example of the lookup file. When I run a search just looking for an individual IP it does return events but is not working with the lookup file. Any help is appreciated.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=wineventlog OR index=fortigate
| lookup TORIP TORIP AS src_ip OUTPUT TORIP
| search TORIP=*&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tkerr1357_0-1650392273708.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/19139iE33061DD5706545C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tkerr1357_0-1650392273708.png" alt="tkerr1357_0-1650392273708.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 14:26:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594335#M206856</guid>
      <dc:creator>tkerr1357</dc:creator>
      <dc:date>2022-04-20T14:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup search help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594337#M206857</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/34998"&gt;@tkerr1357&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this search and see if it produces the data you're looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=wineventlog OR index=fortigate
[| inputlookup TORIP |rename "TORIP" as "src_ip" |return 999 "src_ip"]&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 19 Apr 2022 18:54:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594337#M206857</guid>
      <dc:creator>Stefanie</dc:creator>
      <dc:date>2022-04-19T18:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup search help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594344#M206858</link>
      <description>&lt;P&gt;the search worked but seems like its returning all IPs not just the ones in the lookup file.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 20:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594344#M206858</guid>
      <dc:creator>tkerr1357</dc:creator>
      <dc:date>2022-04-19T20:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup search help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594352#M206862</link>
      <description>&lt;P&gt;That search seems to be a valid search, but it is looking for all events for all&amp;nbsp; IPs in that index/sourcetype and then retaining only rows that have a src_ip in the lookup file.&lt;/P&gt;&lt;P&gt;What exactly is not working here? Do you have an event with a src_ip that is in the lookup file that is not being shown?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 22:25:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594352#M206862</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-19T22:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup search help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594460#M206902</link>
      <description>&lt;P&gt;When I run a search for one of the individual ips in the lookup file it returns events.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 14:19:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594460#M206902</guid>
      <dc:creator>tkerr1357</dc:creator>
      <dc:date>2022-04-20T14:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup search help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594552#M206929</link>
      <description>&lt;P&gt;Isn't that what the search is supposed to do?&lt;/P&gt;&lt;P&gt;So, if you run that search&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=wineventlog OR index=fortigate src_ip=100.14.174.187
| lookup TORIP TORIP AS src_ip OUTPUT TORIP
| search TORIP=*&lt;/LI-CODE&gt;&lt;P&gt;You are saying it returns events?&lt;/P&gt;&lt;P&gt;Can you be more specific in what you are doing and what is occurring that you believe is not correct&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 22:41:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594552#M206929</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-20T22:41:49Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup search help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594562#M206931</link>
      <description>&lt;P&gt;sorry when I run the search I want to look through those two index's for any event that contans at least one of the ip's in the lookup list&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 01:23:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594562#M206931</guid>
      <dc:creator>tkerr1357</dc:creator>
      <dc:date>2022-04-21T01:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup search help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594592#M206946</link>
      <description>&lt;P&gt;So, what does NOT work in that search?&lt;/P&gt;&lt;P&gt;When you run that search like it is, do you get events?&lt;/P&gt;&lt;P&gt;If you get events, are they events for IP addresses in the list or events for IP addresses NOT in the list or do you get no events.&lt;/P&gt;&lt;P&gt;To be able to help, it would be useful if you can describe what you have done and the results you get and the expected results if that is different.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 06:58:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594592#M206946</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-21T06:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup search help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594873#M207022</link>
      <description>&lt;P&gt;when I run my original search it gets no events.&lt;/P&gt;&lt;P&gt;when I run the following search with an IP that I know to be in those index's over a period of all time it returns no events&lt;/P&gt;&lt;PRE&gt;index=wineventlog OR index=fortigate src_ip=100.14.174.187
| lookup TORIP TORIP AS src_ip OUTPUT TORIP
| search TORIP=*&lt;/PRE&gt;&lt;P&gt;when I run the following search it looks like its just returning any event that has a src_ip in it not just whats in the lookup file&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;index=wineventlog OR index=fortigate [| inputlookup TORIP |rename "TORIP" as "src_ip" |return 999 "src_ip"]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;my hope was to run the search every 24 hrs and return all events that match an IP in the lookup file.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 14:07:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/594873#M207022</guid>
      <dc:creator>tkerr1357</dc:creator>
      <dc:date>2022-04-22T14:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup search help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/595309#M207179</link>
      <description>&lt;P&gt;So, this search returns NO events?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=wineventlog OR index=fortigate src_ip=100.14.174.187&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;or after you add&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| lookup TORIP TORIP AS src_ip OUTPUT TORIP
| search TORIP=*&lt;/LI-CODE&gt;&lt;P&gt;you get no results?&lt;/P&gt;&lt;P&gt;If after the initial phase, then there is no event with a field src_ip as that value, either because it does not exist, or src_ip is not a valid field with that value.&lt;/P&gt;&lt;P&gt;If after the second, there is an issue with the lookup.&lt;/P&gt;&lt;P&gt;The reason the second is returning all IPs is because that evaluated search looks like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=wineventlog OR index=fortigate (src_ip="IP_1") OR (src_ip="IP_2") OR ...&lt;/LI-CODE&gt;&lt;P&gt;which means that you will get ANY event from index=wineventlog OR ANY event from index=fortigate WHERE src_ip matches the set of IPs. - Brackets needed round the index statements.&lt;/P&gt;&lt;P&gt;I assume this statement works and returns all IPs in the lookup file?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| inputlookup TORIP
| search TORIP=*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2022 23:50:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-is-my-Lookup-search-not-returning-results-correctly/m-p/595309#M207179</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-25T23:50:44Z</dc:date>
    </item>
  </channel>
</rss>

