LDAP Search

In this article

Overview

You can use the LDAP Search Snap to perform an LDAP search based on the Distinguished Name (DN) with a specific filter.

Snap Type

The LDAP Search is a Read-type Snap.

Prerequisites

None.

Support for Ultra Pipelines

Works in Ultra Task Pipelines.

Limitations and Known Issues

None.

Behavior Change

As of 432patches19873 Snap Pack version, any LDAP entry attribute that contains binary data will be displayed as a byte array (Base64 encoded) instead of a string in the output.

Snap Views

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input

Document

  • Min: 0

  • Max: 1

File Reader followed by CSV Parser. 

The distinguished name of the unit to search, the scope of the search, and the filter to be applied.

Output

Document

  • Min: 0

  • Max: 1

N/A

The entry (if it exists) will be displayed with all its attributes.

Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab:

  • Stop Pipeline Execution: Stops the current pipeline execution if the Snap encounters an error.

  • Discard Error Data and Continue: Ignores the error, discards that record, and continues with the remaining records.

  • Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap Settings

  • Asterisk ( * ): Indicates a mandatory field.

  • Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.

  • Expression icon ( ): Indicates the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.

  • Add icon ( ): Indicates that you can add fields in the field set.

  • Remove icon ( ): Indicates that you can remove fields from the field set.

  • Upload icon ( ): Indicates that you can upload files.

Field Name

Field Type

Description

Field Name

Field Type

Description

Label*

Default Value: LDAP Search
ExampleSearch

String

Specify a unique name for the Snap.

Distinguished name*

Default Value: None
Examplecn=syed,ou=People,dc=Snaplogic,dc=com

String

Specify the distinguished name of the entry you want to modify.

Pass through

Default Value: Deselected

Checkbox

Select this checkbox to enable the Snap to pass the input data to the downstream Snap and display in the output document.

In certain scenarios, the Snap might be unable to process the entire input due to limitations imposed by the endpoint's API. In such cases, we recommend that you select the Pass through checkbox to ensure that the unprocessed input is not lost. You can process the remaining input data using more of the same Snap in the pipeline. Alternatively, you can also write the original data into a separate file using a combination of the Mapper Snap and the File Writer Snap. 

Include string representation for binary attributes

Checkbox

Select this checkbox to add a string representation of all binary attributes. When selected, the string representation of attribute values are appended to the output document, with a _str postfix.

Search scope*

Default ValueOBJECT
Example: SUBTREE

 

Dropdown list

Select one of the scopes for the search:

  • OBJECT (within the unit)

  • ONELEVEL (within the unit and its immediate children)

  • SUBTREE (within the unit and all its descendants)

Filter*

Default Value: N/A
Example(cn=s*)

String/Expression

Specify the filter to refine and return the search results.  

  • The filter must be enclosed in parentheses.

  • Refer to the table below for the filter options supported by this Snap.
    Learn more about LDAP filters.

Attributes


Default Value: None
Example: givenName

String

Specify the attributes that the Snap must return in the output. If you do not add any attributes, the output displays all the attributes by default.

 

 

Different filters supported by the LDAP Search Snap

Filter

Syntax for the filter

Filter

Syntax for the filter

Equality:

(attribute=abc)

for example (&(objectclass=user)(displayName=Foeckeler)

Negation:NOT Filter

(!(attribute=abc))

for example (!objectClass=group)

Presence:

(attribute=*)

for example (mailNickName=*)

Absence:

(!(attribute=*))

for example (!proxyAddresses=*)

Greater than:

(attribute>=abc)

for example (mdbStorageQuota>=100000)

Less than:

(attribute<=abc)

for example (mdbStorageQuota<=100000)

Proximity:

(attribute~=abc)

for example (displayName~=Foeckeler) Caution: ~= is treated as = in ADS environments !!

Wildcards or substring:

for example (sn=F*) or (mail=*@cerrotorre.de) or (givenName=*Paul*)

Examples

Fetching records using and not filters

The example pipeline demonstrates how to use and not filters to fetch records based on the specified common name (cn).

Step1: Configure the LDAP Search Snap with the Distinguished name as follows:

Step 2: Configure specific filters to obtain the required results, as shown below.

When you are not using any filter, we are checking the presence.

 

The Snap displays the records that start with the word user in the cn field. Here, you can see a single record.

 

not filter

Configure the LDAP Search Snap with a not filter.

 

The Snap displays all the records that do not start with the word user in the cn attribute.

 

and not nested filter

Configure the LDAP Search Snap with a nested filter.

 

The Snap displays all the records that do not start with adduser but start with the word user in the cn field. The Snap displays only one such record.

 

Download this pipeline.

Search results without any attributes

Search result with givenName and Company as the attributes