Problem
You have an LDAP entry with an attribute that consists of json entries, and you would like to use ldapsearch to filter on a json item condition.
So having the attribute
mobileIDAuthenticator: {“creationDateTime”:”2023-08-28T14:53:29.061Z”,”state”:”ENABLED”,”mobileNumber”:”+411111111″,”mobileSerialNumber”:”AAAAAAAAAAAAA”}
you would like to filter on the state item.
Solution
you can use the following syntax:
ldapsearch -LLL -H "ldaps://domain.com:1636" -D "cn=Directory Manager" -w $LDP -o ldif_wrap=no -c -vvvv -b "ou=persons,dc=domain,dc=com" -s sub "(mobileIdAuthenticator=state eq 'ENABLED')" uid mobileIDAuthenticator