first commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
# 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.
|
||||
|
||||
``` console
|
||||
# cat /var/log/slapd.log | ./openldap-log-parser | jq
|
||||
```
|
||||
|
||||
Use -f flag to flatten json structure:
|
||||
|
||||
``` console
|
||||
# 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" :
|
||||
``` console
|
||||
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")
|
||||
```
|
||||
Reference in New Issue
Block a user