From 903592d2c82f59da75b37cdbc3bb7530a6b761f9 Mon Sep 17 00:00:00 2001 From: d34dh0r53 Date: Tue, 28 Oct 2014 17:16:31 -0500 Subject: [PATCH] Ensure that rsyslog state files are unique Since there are certain containers that contain multiple logfiles we need to ensure that there is a state file for each log file and not just for each container. This causes rsyslog to spool endlessly --- rpc_deployment/roles/rsyslog_config/templates/genlog.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rpc_deployment/roles/rsyslog_config/templates/genlog.py b/rpc_deployment/roles/rsyslog_config/templates/genlog.py index b11e62448b..556a0697e5 100644 --- a/rpc_deployment/roles/rsyslog_config/templates/genlog.py +++ b/rpc_deployment/roles/rsyslog_config/templates/genlog.py @@ -31,11 +31,14 @@ for log in matches: container = log.split('/')[3] service = log.split('/')[4].split('.')[0] if 'horizon' in container: - service = container + '_' + service + service = container + '_' + service + + if 'logstash' in container: + continue print "$InputFileName {}".format(log) - print "$InputFileTag {}:".format(container) - print "$InputFileStateFile state-{}".format(service) + print "$InputFileTag {}.{}:".format(container, service) + print "$InputFileStateFile state-{}-{}".format(container, service) print "$InputFileFacility local7" print "$InputRunFileMonitor\n"