I run rsyslog in docker containers to send UDP messages to logstash.
When I sign into the docker container and type:
service rsyslog status
shows:
rsyslogd is not running ... failed!
However, while I am in the container, if I type:
service rsyslog start
It runs perfectly without errors and cannot be a sign of why it did not work at the beginning.
I CAN'T SHOW WHY IT IS REFUSED !!!!
* The conf rsyslog file has not been changed, except for modules that allow imfile. Rsyslog.conf is as follows:
# /etc/rsyslog.conf Configuration file for rsyslog.
* I have a script file that runs rsyslog
if [[ -z "$(pgrep rsyslog)" ]]; then echo "starting rsyslog" service rsyslog start fi
My conf file looks like this:
##Get Nginx Error Logs $InputFileName /var/log/nginx/error.log $InputFileTag http-error $InputFileStateFile stat-nginx-error $InputFileSeverity error $InputFileFacility local7 $InputRunFileMonitor #GRAB PHP-FPM ACCESS LOGS $InputFileName /var/log/php-fpm/access_log $InputFileTag php-fpm-access $InputFileStateFile stat-php-fpm-access $InputFileSeverity info $InputFileFacility local7 $InputRunFileMonitor #GRAB PHP-FPM ERROR LOGS $InputFileName /var/log/php-fpm/error_log $InputFileTag php-fpm-error $InputFileStateFile stat-php-fpm-error $InputFileSeverity error $InputFileFacility local7 $InputRunFileMonitor #Json Template template(name="json_temp" type="list") { constant(value="{") constant(value="\"@timestamp\":\"") property(name="timegenerated" dateFormat="rfc3339") constant(value="\",\"message\":\"") property(name="msg") constant(value="\",\"severity_label\":\"") property(name="syslogseverity-text") constant(value="\",\"severity\":\"") property(name="syslogseverity") constant(value="\",\"facility_label\":\"") property(name="syslogfacility-text") constant(value="\",\"facility\":\"") property(name="syslogfacility") constant(value="\",\"program\":\"") property(name="programname") constant(value="\",\"pid\":\"") property(name="procid") constant(value="\",\"rawmsg\":\"") property(name="rawmsg") constant(value="\",\"syslogtag\":\"") property(name="syslogtag") constant(value="\"}\n") } if $programname == 'http-error' then @ip.address:port;json_temp if $programname == 'http-error' then stop if $programname == 'php-fpm-access' then @ip.address:port;json_temp if $programname == 'php-fpm-access' then stop if $programname == 'php-fpm-error' then @ip.address:port;json_temp if $programname == 'php-fpm-error' then stop *.* @ip.address:port;json_temp
Any help would be awesome because I don't understand why it doesn't start.
Greetings
source share