<?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 How does one use an OR ldap query in ldapfilter? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-does-one-use-an-OR-ldap-query-in-ldapfilter/m-p/276765#M32445</link>
    <description>&lt;P&gt;Example:&lt;BR /&gt;
Splunk does not like the &lt;CODE&gt;|&lt;/CODE&gt; in the ldap query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapfilter domain=DIR search="(|(sAMAccountName=$User$)(objectSid=$SID$))" attrs="cn,objectSid"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also does not work to escape it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapfilter domain=DIR search="(\|(sAMAccountName=$User$)(objectSid=$SID$))" attrs="cn,objectSid"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 06 Apr 2016 15:54:57 GMT</pubDate>
    <dc:creator>tomcochran</dc:creator>
    <dc:date>2016-04-06T15:54:57Z</dc:date>
    <item>
      <title>How does one use an OR ldap query in ldapfilter?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-does-one-use-an-OR-ldap-query-in-ldapfilter/m-p/276765#M32445</link>
      <description>&lt;P&gt;Example:&lt;BR /&gt;
Splunk does not like the &lt;CODE&gt;|&lt;/CODE&gt; in the ldap query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapfilter domain=DIR search="(|(sAMAccountName=$User$)(objectSid=$SID$))" attrs="cn,objectSid"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also does not work to escape it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapfilter domain=DIR search="(\|(sAMAccountName=$User$)(objectSid=$SID$))" attrs="cn,objectSid"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Apr 2016 15:54:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-does-one-use-an-OR-ldap-query-in-ldapfilter/m-p/276765#M32445</guid>
      <dc:creator>tomcochran</dc:creator>
      <dc:date>2016-04-06T15:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: How does one use an OR ldap query in ldapfilter?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-does-one-use-an-OR-ldap-query-in-ldapfilter/m-p/276766#M32446</link>
      <description>&lt;P&gt;Take a look at this: &lt;A href="https://tools.ietf.org/search/rfc2254"&gt;https://tools.ietf.org/search/rfc2254&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   If a value should contain any of the following characters

           Character       ASCII value
           ---------------------------
           *               0x2a
           (               0x28
           )               0x29
           \               0x5c
           NUL             0x00

   the character must be encoded as the backslash '\' character (ASCII
   0x5c) followed by the two hexadecimal digits representing the ASCII
   value of the encoded character. The case of the two hexadecimal
   digits is not significant.

   This simple escaping mechanism eliminates filter-parsing ambiguities
   and allows any filter that can be represented in LDAP to be
   represented as a NUL-terminated string. Other characters besides the
   ones listed above may be escaped using this mechanism, for example,
   non-printing characters.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Specifically this:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;Other characters besides the ones listed above may be escaped using this mechanism, for example, non-printing characters.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Therefore I would try the following. Please let me know if works as I don't have a test lab to verify:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| ldapfilter domain=DIR search="(\7c(sAMAccountName=$User$)(objectSid=$SID$))" attrs="cn,objectSid"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Apr 2016 18:20:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-does-one-use-an-OR-ldap-query-in-ldapfilter/m-p/276766#M32446</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-04-06T18:20:36Z</dc:date>
    </item>
  </channel>
</rss>

