Workaround:
To query the connected hosts start by adding the following to the global options of the Syslog-ng configuration file:
stats-level(2);
After settings the above option, please restart the Syslog-ng service or reload the configuration.
Once done, run the following command to get a list of the connected hosts:
/opt/syslog-ng/sbin/syslog-ng-ctl stats | egrep 'src.host.*processed' | cut -d';' -f 3
This command can be used in conjunction with scripts and other forms of export to query and/or keep an on-going list of connected hosts.
Below is an example cron job that uses the above command to output the list of connected hosts to a file:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
0 * * * * root /opt/syslog-ng/sbin/syslog-ng-ctl stats | egrep 'src.host.*processed' | cut -d';' -f 3 > /opt/syslog-ng/var/stats/hosts
© 2025 One Identity LLC. ALL RIGHTS RESERVED. 利用規約 プライバシー Cookie Preference Center