<?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: Splunk Query with Ldap Info in Security</title>
    <link>https://community.splunk.com/t5/Security/Splunk-Query-with-Ldap-Info/m-p/30364#M1005</link>
    <description>&lt;P&gt;that worked out perfect, missing one " right after search=&lt;/P&gt;

&lt;P&gt;can you explain $src_nt_domain$ &amp;amp; $user$, i would've assumed &lt;/P&gt;

&lt;P&gt;ldapfilter domain=mydomain search="(&amp;amp;(objectClass=user)(sAMAccountName=src_user))"&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 13:53:04 GMT</pubDate>
    <dc:creator>gdavid</dc:creator>
    <dc:date>2020-09-28T13:53:04Z</dc:date>
    <item>
      <title>Splunk Query with Ldap Info</title>
      <link>https://community.splunk.com/t5/Security/Splunk-Query-with-Ldap-Info/m-p/30362#M1003</link>
      <description>&lt;P&gt;I'm trying to join 2 queries together in  a table&lt;/P&gt;

&lt;P&gt;From the Active Directory App, i took this query:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;eventtype=msad-account-lockout  | eval actor=if(EventCode==4767 OR EventCode==671,src_user,src_host) | eval DateTime=strftime(_time, "%c") | table DateTime,signature,user,actor | rename signature as "Action",user as User, actor as "Change On/By"&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Then i wanted to get the phone numbers from ldap to call the users so i tried to append this in between with no luck.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;| ldapsearch domain=&lt;/EM&gt;&lt;EM&gt;mydomain&lt;/EM&gt;* search="(&amp;amp;(objectClass=user)(sAMAccountName=&lt;STRONG&gt;myuser&lt;/STRONG&gt;))" attrs="dn,mobile,telephoneNumber"*&lt;/P&gt;

&lt;P&gt;Errors:&lt;BR /&gt;
Error in 'ldapsearch' command: This command must be the first command of a search.&lt;/P&gt;

&lt;P&gt;can anyone assist? both return results when run independently. the end goal is to setup a real time alert for the lockouts with phone numbers in the emails.&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:52:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Splunk-Query-with-Ldap-Info/m-p/30362#M1003</guid>
      <dc:creator>gdavid</dc:creator>
      <dc:date>2020-09-28T13:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query with Ldap Info</title>
      <link>https://community.splunk.com/t5/Security/Splunk-Query-with-Ldap-Info/m-p/30363#M1004</link>
      <description>&lt;P&gt;You need to use ldapfilter instead.&lt;/P&gt;

&lt;P&gt;Go into the SA-ldapsearch app and look at the documentation - it's similar to ldapsearch, but does searches against the event pipeline.  You will need to add in src_nt_domain, so something like this should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype=msad-account-lockout | eval actor=if(EventCode==4767 OR EventCode=671,src_user,src_host) | ldapfilter domain=$src_nt_domain$ search=(&amp;amp;(objectClass=user)(sAMAccountName=$user$))" attrs="mobile,telephoneNumber" | table _time,signature,user,actor,mobile,telephoneNumber | rename signature as "Action", user as "Locked User", actor as "Changed By", mobile as "Cell", telephoneNumber as "Phone"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Enjoy!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Splunk-Query-with-Ldap-Info/m-p/30363#M1004</guid>
      <dc:creator>ahall_splunk</dc:creator>
      <dc:date>2020-09-28T13:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query with Ldap Info</title>
      <link>https://community.splunk.com/t5/Security/Splunk-Query-with-Ldap-Info/m-p/30364#M1005</link>
      <description>&lt;P&gt;that worked out perfect, missing one " right after search=&lt;/P&gt;

&lt;P&gt;can you explain $src_nt_domain$ &amp;amp; $user$, i would've assumed &lt;/P&gt;

&lt;P&gt;ldapfilter domain=mydomain search="(&amp;amp;(objectClass=user)(sAMAccountName=src_user))"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:53:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Splunk-Query-with-Ldap-Info/m-p/30364#M1005</guid>
      <dc:creator>gdavid</dc:creator>
      <dc:date>2020-09-28T13:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Query with Ldap Info</title>
      <link>https://community.splunk.com/t5/Security/Splunk-Query-with-Ldap-Info/m-p/30365#M1006</link>
      <description>&lt;P&gt;nevermind, i see my mistake.&lt;/P&gt;

&lt;P&gt;additional note: i was getting peridoic emails with no numbers, i noticed that the active directory app doesn't seem to pick up src_nt_domain from 2008 r2 domain controller events properly. i hard-coded my domain in the ldap search as i only have 1.&lt;/P&gt;

&lt;P&gt;thanks for you help again.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:53:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/Splunk-Query-with-Ldap-Info/m-p/30365#M1006</guid>
      <dc:creator>gdavid</dc:creator>
      <dc:date>2020-09-28T13:53:09Z</dc:date>
    </item>
  </channel>
</rss>

