Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vetinari/ldifsearch
filter entries from an LDIF file
https://github.com/vetinari/ldifsearch
Last synced: about 2 months ago
JSON representation
filter entries from an LDIF file
- Host: GitHub
- URL: https://github.com/vetinari/ldifsearch
- Owner: vetinari
- Created: 2014-11-24T18:55:25.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-30T06:14:06.000Z (about 10 years ago)
- Last Synced: 2023-04-13T14:36:58.878Z (over 1 year ago)
- Language: Perl
- Size: 133 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NAME
ldifsearch - filter entries from an LDIF file
# SYNOPSIS
ldifsearch -L LDIF [-S SCHEMA_LDIF] \
[OPTIONS] [FILTER [ATTR [ATTR [ ... ]]]]ldifsearch -L LDIF [-S SCHEMA_LDIF] \
[OPTIONS] ldap:///SEARCH_BASE?SCOPE?FILTER?ATTR,ATTR# DESCRIPTION
ldifsearch searches an LDIF file with the LDAP filter FILTER, similar to
[ldapsearch(1)](http://man.he.net/man1/ldapsearch) and writes all matching entries as LDIF to stdout, when
ATTRs are also given, only the DN and the given attributes (if present).# NOTES
The second argument form of passing an `ldap://` URI ignores all passed
_\--base_ and _\--scope_ options as well as any extra args passed as
attributes.This script requires at least version 0.50 of the
[Net::LDAP](https://github.com/perl-ldap/perl-ldap) distribution
(i.e. Net::LDAP::FilterMatch version 0.23) and Net::LDAP::DN from
[https://github.com/vetinari/perl-net-ldap-dn](https://github.com/vetinari/perl-net-ldap-dn).# OPTIONS
- \--ldif=LDIF
- \-L LDIFThe LDIF file to use.
- \--schema=LDIF
- \-S LDIFThe schema LDIF file to use for matching rules, see [Net::LDAP::FilterMatch](http://search.cpan.org/perldoc?Net::LDAP::FilterMatch).
To retrieve the schema for your LDAP server use:perl -MNet::LDAP -MNet::LDAP::Schema \
-e 'Net::LDAP->new(shift)->schema()->dump()' $LDAP_URI > schema.ldif- \--base=BASE
- \-b BASESearch base for queries, if not given, searches all entries in the LDIF
file.- \--scope=SCOPE
- \-s SCOPEThe search scope. One of `sub`, `base` or `one`, defaults to `sub`.
- \--attrs-only
- \-AOnly print attributes
- \--ref OC,ATTR,REF\_ATTR
- \-r OC,ATTR,REF\_ATTRAdd references for objectClass OC: the DN of the object will be added as
attribute REF\_ATTR for all DNs referenced by the value of ATTR. Example:All _member_ of a _groupOfNames_ get a _memberOf_ attribute with the
DN of the _groupOfNames_ as value.This option is usually not needed when the LDIF file is the result of
an ldapsearch with `* +` as attribute arguments, the (operational)
_memberOf_ attribute should be present when your LDAP server supports
it. For OpenLDAP's slapd the _memberof_ module must be loaded (...
before __any__ _member_ attribute is set) to get the _memberOf_
attribute.- \--memberof
- \-mShortcut for `--ref=groupOfNames,member,memberOf`
- \--dynlist OC,ATTR
- \--dynlist OC,ATTR,REF\_ATTR,REF\_REF
- \-D OC,ATTR
- \-D OC,ATTR,REF\_ATTR,REF\_REFAdd dynamic list support like [slapo-dynlist(5)](http://man.he.net/man5/slapo-dynlist). When called with four
arguments it will build the REF\_REF attribute in a second run. Example:
`--dynlist=groupOfURLs,labeledURI,member,memberOf` will resolve the
query given in the _labeledURI_ in to the _member_ attribute which is
then resolved to the _memberOf_ attribute (see above for ["--ref"](#--ref)).- \--dyngroup
- \-dShortcut for `--dynlist=groupOfURLs,labeledURI,member,memberOf`
- \--opt K=V
- \-o K=VGeneral options.
Only known key is "ldif-wrap", value: "no" or a number, see [Net::LDAP::LDIF](http://search.cpan.org/perldoc?Net::LDAP::LDIF)
about wrapping long lines- \--sizelimit=INT
- \-z INTReturn max INT matches.
# SEE ALSO
[Net::LDAP](http://search.cpan.org/perldoc?Net::LDAP), [Net::LDAP::LDIF](http://search.cpan.org/perldoc?Net::LDAP::LDIF), [ldapsearch(1)](http://man.he.net/man1/ldapsearch), [Net::LDAP::DN](http://search.cpan.org/perldoc?Net::LDAP::DN)
# AUTHOR
Hanno Hecker