Log messages being duplicated

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Log messages being duplicated

Post by tmcdonald »

I agree it has to do with the order, specifically which file has the "if $programname == 'tomcat' then ~" line present. That would prevent this from showing up in the normal syslog location which would be picked up and sent a second time. Currently your first one (the nagios.conf) is not discarding the message after sending, and your second (the rsyslog.conf) is. By placing nagios.conf after you are essentially skipping it.

Add: Normally we handle this by using numerals to control the order, such as "/etc/rsyslog.d/90-nagioslogserver_var_log_httpd_access_log.conf".
Former Nagios employee
bdgoecke
Posts: 36
Joined: Wed Oct 22, 2014 3:41 pm

Re: Log messages being duplicated

Post by bdgoecke »

The order does matter for rsyslog, the forwarder needs to be last. That is the way rsyslog works. I was able to verify this on my test machines, if I moved the nagios log server forward entry to the front/top of the list then I get duplicated messages.

When we configure our forwarder we put it at "99-nagioslogserver.conf" to try to be sure it is the last config processed.

Sorry for the confusion, we will try and document this better in the future.
User avatar
globalgiving
Posts: 25
Joined: Thu Aug 28, 2014 9:57 am
Location: Washington, DC
Contact:

Re: Log messages being duplicated

Post by globalgiving »

Thanks all! Yeah, better documentation would have been great.
Justin Rupp
Senior Systems Ninja
GlobalGiving Foundation
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: Log messages being duplicated

Post by cmerchant »

We'll go ahead and close this thread. Thanks.
Locked