LDAP exclude user with specific titles from Graylog

I’m trying to config my Graylog’s LDAP settings in such way that user with specific titles, let’s say, “testers”, will not be allowed to login into Graylog trough LDAP.

From my understanding I have to specify a filter in User Search Pattern?

I tried something like this : (&(objectClass=user)(sAMAccountName={0})(!title=testers))
but sadly it didn’t work. With that setting in Pattern LDAP is not working at all. Could you help?


Based on yout ldap server, it could be different.
First try it without the title extension. Are you sure the sAMAccountName contains your username.

Based on my little resource, you shoud use ! before (.
(!title=testers) -> (!(title=testers))

You can also try ldapquery to be sure you get back user to your query and exclude any other graylog settings.

// We use a group to control the list of the users who can login to GL

That’s the one that works right now :slight_smile:


This case is solved but right now I’m trying to expand it to also exclude people without any title - field title is empty for them.

I tried doing it like that:


Sadly it does not work.

of course

Check it again.
Syntax error in your query.
Check this part : (!(|(title=testers*))(title=*))
No logical condition between the two title

You mean something like this?


It does not work too :confused:

Also it looks like even if I try only excluding empty titles it doesn’t filter people too:

(&(objectClass=user)(sAMAccountName={0})(!(|(title=*)))) - does not work

no, it is you original query part.
check the parenthesis
syntax error.
| means OR, but you don’t use any other condition.

Well the original query works like a charm, it excludes users with title “testers”.

(&(objectClass=user)(sAMAccountName={0})(!(title=*))) - does not

(&(objectClass=user)(sAMAccountName={0})(!(title=testers))(title=*)) - also doesn’t work :confused:

No one is able to log in while above are used

I can’t tell more. Play.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.