Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At the end of my ldapsearch results I always get something like the following:

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

I know what the rest of it is doing, but I can't find any info on what the search: 2 line signifies. Any ideas? Is it the message ID? (with msgId:1 being the bind I guess)

(sigh, less than 200 rep means 'ldapsearch' isn't a valid tag...)

share|improve this question
The commented LDIF output of the old OpenLDAP search tool can be repressed with the -L, -LL, or -LLL command line options. – Terry Gardner Oct 8 '11 at 10:32
up vote 1 down vote accepted

2 is indeed the messageID of the search operation.

From the source code of OpenLDAP, file clients/tools/ldapsearch.c, function print_result():

1823         if( search ) {
1824                 if ( ldif < 2 ) {
1825                         printf(_("# search result\n"));
1826                 }
1827                 if ( ldif < 1 ) {
1828                         printf("%s: %d\n", _("search"), ldap_msgid(result) );
1829                 }
1830         }

You can verify this with a packet sniffer such as Wireshark. If, for example, SASL GSSAPI authentication is used, then the search operation will be #5, resulting in search: 5.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .