Parse openldap log, and output json format
openldap-log-parser | ||
test | ||
.gitignore | ||
go.mod | ||
go.sum | ||
LICENSE | ||
openldap-log-parser.go | ||
README.md |
openldap-log-parser
Parse openldap log, and output json format
At the moment, openldap-log-parser focus on these log levels:
- 256 (stats log connections/operations/results)
Install
Copy openldap-log-parser
into your PATH and set executable flag.
Usage
Input openldap logs as os stdin.
# cat /var/log/slapd.log | ./openldap-log-parser | jq
Use -f flag to flatten json structure:
# cat /var/log/slapd.log | ./openldap-log-parser -f | jq
Use "-o filename.json" to write output to file.
Piping rsyslog to openldap-log-parser
You can feed syslog to openldap-log-parser by using "omprog" rsyslog module, with template "RSYSLOG_FileFormat" :
module(load="omprog")
[...]
if $programname == "slapd" then
action(
type="omprog"
binary="/usr/local/bin/openldap-log-parser -f -o /var/log/slapd.log.json"
template="RSYSLOG_FileFormat")