Example of the changelog features
After the changelog-max-before-after-values property is set, the before and after values of any change attribute are recorded in the LDAP changelog.
For example, consider a simple entry with two multi-valued mail attributes.
dn: uid=test,dc=example,dc=com objectclass: inetorgperson cn: test user sn: user description: oldDescription mail: test@yahoo.com mail: test@gmail.com
Then, apply the following changes to the entry.
dn: uid=test,dc=example,dc=com changetype: modify add: mail mail: test@hotmail.com - delete: mail mail: test@yahoo.com - replace: description description: newDescription
The resulting changelog would record the following attribute values.
dn: changeNumber=1,cn=changelog objectClass: top objectClass: changeLogEntry targetDN: uid=test,dc=example,dc=com changeType: modify changes:: YWRkOiBtYWlsCm1haWw6IHRlc3RAaG90bWFpbC5jb20KLQpkZWxldGU6IG1haWwKbWFpbDogdGVzdEB5YWh vby5jb20KLQpyZXBsYWNlOiBkZXNjcmlwdGlvbgpkZXNjcmlwdGlvbjogbmV3RGVzY3JpcHRpb24KLQpyZX BsYWNlOiBtb2RpZmllcnNOYW1lCm1vZGlmaWVyc05hbWU6IGNuPURpcmVjdG9yeSBNYW5hZ2VyLGNuPVJvb 3QgRE5zLGNuPWNvbmZpZwotCnJlcGxhY2U6IGRzLXVwZGF0ZS10aW1lCmRzLXVwZGF0ZS10aW1lOjogQUFB QkxxQitIaTQ9Ci0KAA== ds-changelog-before-values:: ZGVzY3JpcHRpb246IG9sZERlc2NyaXB0aW9uCm1haWw6IHRlc3RAeW Fob28uY29tCm1haWw6IHRlc3RAZ21haWwuY29tCmRzLXVwZGF0ZS10aW1lOjogQUFBQkxxQjdaZ1E9Cm1vZ GlmaWVyc05hbWU6IGNuPURpcmVjdG 9yeSBNYW5hZ2VyLGNuPVJvb3QgRE5zLGNuPWNvbmZpZwo= ds-changelog-after-values:: ZGVzY3JpcHRpb246IG5ld0Rlc2NyaXB0aW9uCm1haWw6IHRlc3RAZ21 haWwuY29tCm1haWw6IHRlc3RAaG90bWFpbC5jb20KZHMtdXBkYXRlLXRpbWU6OiBBQUFCTHFCK0hpND0KbW 9kaWZpZXJzTmFtZTogY249RGlyZWN0b3J5IE1hbmFnZXIsY249Um9vdCBETnMsY249Y29uZmlnCg== ds-changelog-entry-key-attr-values:: dWlkOiB0ZXN0Cg== changenumber: 1
Run the bin/base64 decode -d command line tool to view the decoded value for the changes, ds-changelog-before-values, and ds-changelog-after-values attributes.
After base64 decoding, the changes attribute displays the following.
add: mail mail: test@hotmail.com - delete: mail mail: test@yahoo.com - replace: description description: newDescription - replace: modifiersName modifiersName: cn=Directory Manager,cn=Root DNs,cn=config - replace: modifyTimestamp modifyTimestamp: 20131010020345.546Z -
After base64 decoding, the ds-changelog-before-values attribute displays the following.
description: oldDescription mail: test@yahoo.com mail: test@gmail.com modifyTimestamp: 20131010020345.546Z modifiersName: cn=Directory Manager,cn=Root DNs,cn=config
After base64 decoding, the ds-changelog-after-values attribute displays the following.
description: newDescription mail: test@gmail.com mail: test@hotmail.com modifyTimestamp: 20131010020345.546Z modifiersName: cn=Directory Manager,cn=Root DNs,cn=config