Skip to content

Commit

Permalink
fix: add search and correct base_dn for ldap search with logger debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriel Perkins committed Mar 24, 2023
1 parent f8d0a6c commit 8013e36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 2 additions & 0 deletions scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ func ldapClient(ldapRcvr *ldapReceiver) *ldap.Conn {

// Get the results from an ldapsearch by making a connection to LDAP and returning the search
func getResults(conn *ldap.Conn, ldapRcvr *ldapReceiver) (search *ldap.SearchResult) {
ldapRcvr.logger.Sugar().Debugf("search filter is: %v", ldapRcvr.config.SearchFilter)

search = performSearch(conn, fmt.Sprint(ldapRcvr.config.SearchFilter), ldapRcvr)

ldapRcvr.logger.Sugar().Debugf("Number of returned Entries: %d", len(search.Entries))
Expand Down
10 changes: 2 additions & 8 deletions testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@ receivers:
grpc:
ldap:
interval: 10s
search_filter: "(&(objectClass=group)(|MyGroup*))"
search_filter: "(objectclass=*)"
endpoint: "localhost"
# TODO: use basic auth
user: "cn=admin,dc=example,dc=org"
pw: "admin"
base_dn: "DC=LUV,DC=AD,DC=SWACORP,DC=com"
base_dn: "dc=example,dc=org"
ignore_tls: true

#ldap:
# interval: "10"
# #ldapreceiver:
# # interval: 10


processors:

Expand Down

0 comments on commit 8013e36

Please sign in to comment.