<?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: Inputlookup command not working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-command-not-working/m-p/530826#M149949</link>
    <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;append&lt;/FONT&gt; command adds rows to your output rather than columns (that would be &lt;FONT face="courier new,courier"&gt;appendcols&lt;/FONT&gt;, but don't use that here).&amp;nbsp; Appended rows often need to be combined with earlier rows.&amp;nbsp; We can use &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; to do that.&lt;/P&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; command only looks at a single event so anything it compares must be in that one event.&amp;nbsp; In the example, only events containing both a user and a sAMAccountName field (which should be none of them) will have "MATCH".&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| ldapsearch domain="default" search="(&amp;amp;(objectClass=user))" attrs="sAMAccountName, distinguishedName" 
| rename sAMAccountName as user
| append 
    [| inputlookup account_status_tracker | fields Latest, user] 
| stats values(*) as * by user
```Now the ldapsearch output is matched up with the inputlookup```
```Any row without a distinguishedName field didn't have an entry in ```
```ldapsearch so we can drop it.```
| where isnotnull(distinguishedName)
```Replace the table command with outputlookup to save the results in the lookup file```
| table Latest user&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 25 Nov 2020 14:07:13 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2020-11-25T14:07:13Z</dc:date>
    <item>
      <title>Inputlookup command not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-command-not-working/m-p/530816#M149948</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have been trying to use a search in order to compare two results. One is my lookup and one with an ldapsearch. I am trying to only keep the records of users who are actually still in the AD.&lt;/P&gt;&lt;P&gt;So my lookup contains the usernames and latest login time and my ldapsearch obviously has the updated list of every account still in the AD.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My goal is to crosscheck if there are rows in the lookup that could be delete which is the goal of my query. So far I have the following but I am unable to append the lookup file. Can anyone help me achieve my goal? Tell me if this is the best way to do it and otherwise help me? If it this the best way can you correct my search?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| ldapsearch domain="default" search="(&amp;amp;(objectClass=user))" attrs="sAMAccountName, distinguishedName" 
| append 
    [| inputlookup account_status_tracker | fields Latest, user] 
| eval match = if(user==sAMAccountName, "MATCH", "NOMATCH")
| table _time sAMAccountName Latest user match&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The table displays the values related to the ldapsearch but not the ones of the lookup file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks anyway,&lt;/P&gt;&lt;P&gt;Sasquatchatmars&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 13:49:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-command-not-working/m-p/530816#M149948</guid>
      <dc:creator>Sasquatchatmars</dc:creator>
      <dc:date>2020-11-25T13:49:47Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup command not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-command-not-working/m-p/530826#M149949</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;append&lt;/FONT&gt; command adds rows to your output rather than columns (that would be &lt;FONT face="courier new,courier"&gt;appendcols&lt;/FONT&gt;, but don't use that here).&amp;nbsp; Appended rows often need to be combined with earlier rows.&amp;nbsp; We can use &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; to do that.&lt;/P&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;eval&lt;/FONT&gt; command only looks at a single event so anything it compares must be in that one event.&amp;nbsp; In the example, only events containing both a user and a sAMAccountName field (which should be none of them) will have "MATCH".&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| ldapsearch domain="default" search="(&amp;amp;(objectClass=user))" attrs="sAMAccountName, distinguishedName" 
| rename sAMAccountName as user
| append 
    [| inputlookup account_status_tracker | fields Latest, user] 
| stats values(*) as * by user
```Now the ldapsearch output is matched up with the inputlookup```
```Any row without a distinguishedName field didn't have an entry in ```
```ldapsearch so we can drop it.```
| where isnotnull(distinguishedName)
```Replace the table command with outputlookup to save the results in the lookup file```
| table Latest user&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 25 Nov 2020 14:07:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-command-not-working/m-p/530826#M149949</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-11-25T14:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup command not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-command-not-working/m-p/530828#M149950</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;This worked like a charm, thank you very much!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sasquatchatmars&lt;/P&gt;</description>
      <pubDate>Wed, 25 Nov 2020 14:11:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-command-not-working/m-p/530828#M149950</guid>
      <dc:creator>Sasquatchatmars</dc:creator>
      <dc:date>2020-11-25T14:11:57Z</dc:date>
    </item>
  </channel>
</rss>

