Chapter 16. Monitoring statistics and metrics of syslog-ng The syslog-ng Premium Edition 7 Administrator Guide
The syslog-ng PE application collects various statistics and measures different metrics about the messages it receives and delivers. These metrics are collected into different counters, depending on the configuration of syslog-ng PE. The
stats-level() global option determines exactly which statistics syslog-ng PE collects. You can access these statistics and metrics using the following methods.
Recommended: Structured, selective methods:
Legacy: Unstructured, bulk methods:
Using the syslog-ng-ctl stats command.
Use the socat application: echo STATS | socat -vv UNIX-CONNECT:/opt/syslog-ng/var/run/syslog-ng.ctl -
If you have an OpenBSD-style netcat application installed, use the echo STATS | nc -U /opt/syslog-ng/var/run/syslog-ng.ctl command. Note that the netcat included in most Linux distributions is a GNU-style version that is not suitable to query the statistics of syslog-ng.