<?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 not working, it is generating a &amp;quot;NOT ()&amp;quot; query for some reason. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-not-working-it-is-generating-a-quot-NOT-quot-query-for/m-p/463566#M130692</link>
    <description>&lt;P&gt;Neither of these work either.  This isn't making any sense whatsoever.&lt;/P&gt;

&lt;P&gt;There is a row in my lookup that has a value for DeviceId as "ABC"&lt;/P&gt;

&lt;P&gt;I can write the splunk query as Properties.DeviceName=ABC, and it returns a row as expected.&lt;/P&gt;

&lt;P&gt;When I add  [| lookup SPCClientMaster   DeviceId as Properties.DeviceName]  I get nothing.  Even though I can write the query |inputlookup SPCClientMaster .csv |search DeviceId=ABC, and it returns a row.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Dec 2019 00:36:56 GMT</pubDate>
    <dc:creator>Cuyose</dc:creator>
    <dc:date>2019-12-10T00:36:56Z</dc:date>
    <item>
      <title>Lookup not working, it is generating a "NOT ()" query for some reason.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-not-working-it-is-generating-a-quot-NOT-quot-query-for/m-p/463562#M130688</link>
      <description>&lt;P&gt;lookup contains 3 columns DeviceId, host, and storeNumber&lt;/P&gt;

&lt;P&gt;splunk events contain a Properties.DeviceName field that matches the DeviceId in the lookup.  &lt;/P&gt;

&lt;P&gt;When I attempt the following&lt;BR /&gt;
baseSearch&lt;BR /&gt;
Properties.DeviceName=*&lt;BR /&gt;
| search Properties.DeviceName IN&lt;BR /&gt;
    [| lookup SPCClientMaster DeviceId AS Properties.DeviceName&lt;BR /&gt;
    ]&lt;/P&gt;

&lt;P&gt;Error in 'search' command: Unable to parse the search: Comparator 'IN' has an invalid term on the right hand side: NOT. &lt;/P&gt;

&lt;P&gt;Why is this happening?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 19:39:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-not-working-it-is-generating-a-quot-NOT-quot-query-for/m-p/463562#M130688</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2019-12-09T19:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not working, it is generating a "NOT ()" query for some reason.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-not-working-it-is-generating-a-quot-NOT-quot-query-for/m-p/463563#M130689</link>
      <description>&lt;P&gt;I'm not sure a lookup command in a subsearch makes sense, it doesn't have anything to look at. You can do one of two things here:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;baseSearch
Properties.DeviceName=*
| search 
[| inputlookup SPCClientMaster DeviceId
  | rename DeviceId as Properties.DeviceName
]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;baseSearch
Properties.DeviceName=*
| lookup SPCClientMaster DeviceId AS Properties.DeviceName OUTPUT fieldThatShowsExistence
| where isnotnull(fieldThatShowsExistence)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I like the first if you just want a straight IN clause, and the second if you want to extract information from the csv. Does that make sense?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 19:48:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-not-working-it-is-generating-a-quot-NOT-quot-query-for/m-p/463563#M130689</guid>
      <dc:creator>aberkow</dc:creator>
      <dc:date>2019-12-09T19:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not working, it is generating a "NOT ()" query for some reason.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-not-working-it-is-generating-a-quot-NOT-quot-query-for/m-p/463564#M130690</link>
      <description>&lt;P&gt;I'm not sure if this is related but if you're trying to run a subsearch your square bracket is not in the right place and you have an extra pipe. Should be like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;baseSearch
Properties.DeviceName=*
[ search Properties.DeviceName IN
| lookup SPCClientMaster DeviceId AS Properties.DeviceName
]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Dec 2019 19:56:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-not-working-it-is-generating-a-quot-NOT-quot-query-for/m-p/463564#M130690</guid>
      <dc:creator>oscar84x</dc:creator>
      <dc:date>2019-12-09T19:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not working, it is generating a "NOT ()" query for some reason.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-not-working-it-is-generating-a-quot-NOT-quot-query-for/m-p/463565#M130691</link>
      <description>&lt;P&gt;This doesn't work as you get the following error&lt;BR /&gt;
Error in 'search' command: Unable to parse the search: Comparator 'IN' is missing a term on the right hand side. &lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 00:30:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-not-working-it-is-generating-a-quot-NOT-quot-query-for/m-p/463565#M130691</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2019-12-10T00:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup not working, it is generating a "NOT ()" query for some reason.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-not-working-it-is-generating-a-quot-NOT-quot-query-for/m-p/463566#M130692</link>
      <description>&lt;P&gt;Neither of these work either.  This isn't making any sense whatsoever.&lt;/P&gt;

&lt;P&gt;There is a row in my lookup that has a value for DeviceId as "ABC"&lt;/P&gt;

&lt;P&gt;I can write the splunk query as Properties.DeviceName=ABC, and it returns a row as expected.&lt;/P&gt;

&lt;P&gt;When I add  [| lookup SPCClientMaster   DeviceId as Properties.DeviceName]  I get nothing.  Even though I can write the query |inputlookup SPCClientMaster .csv |search DeviceId=ABC, and it returns a row.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 00:36:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-not-working-it-is-generating-a-quot-NOT-quot-query-for/m-p/463566#M130692</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2019-12-10T00:36:56Z</dc:date>
    </item>
  </channel>
</rss>

