Synchronizing a field of a JSON attribute into a non-JSON attribute
If the source stores:
ubidEmailJSON: {"value" : "jsmith@example.com", "type" : "home"}
but the destination stores:
mail: jsmith@example.com
To synchronize changes between these systems, a constructed attribute mapping must be configured:
$ bin/dsconfig create-attribute-mapping \
--map-name "Attribute Map" \
--mapping-name mail \
--type constructed \
--set "value-pattern:{ubidEmailJSON.value}"
The value-pattern
syntax allows attributes to be referenced by placing them in {}
. JSON fields within the attribute can be referenced by using the syntax {attribute.field}
. See this property in the Configuration Reference guide, or dsconfig
tool command help for more information.
After the “Attribute Map” is created, it can be referenced from the Sync Class:
$ bin/dsconfig set-sync-class-prop
--pipe-name "A to B" \
--class-name Users \
--set "attribute-map:Attribute Map"
While LDAP attribute names are not case sensitive, the JSON field names are. By default, errors related to attribute mapping are not logged. To enable error logging, configure the Debug Logger with the following: |
$ bin/dsconfig set-log-publisher-prop \
--publisher-name "File-Based Debug Logger" \
--set enabled:true
$ bin/dsconfig create-debug-target \
--publisher-name "File-Based Debug Logger" \
--target-name com.unboundid.directory.sync.mapping \
--set debug-level:warning