Hi Ashish,

rsyslog is writing log messages to disk by default. To discard unwanted 
messages from rsyslog, take a look at 
http://www.rsyslog.com/writing-specific-messages-to-a-file-and-discarding-them/ 
and http://www.rsyslog.com/discarding-unwanted-messages/ and keep in mind, 
that the order of statements in the rsyslog configuration file is important.

Cheers,
Jochen

On Monday, 11 April 2016 19:14:02 UTC+2, Ashish Barmase wrote:
>
> Hi,
>
> I am trying to monitor the mongodb log file. /var/log/mongodb/mongod.log. 
> I'm encountering an issue, is that after forwarding log to graylog, the 
> same log lines again getting written into /var/log/messages. I'm using 
> amazon linux and rsyslog version 5.8. 
>
> Below is my /etc/rsyslog.d/22-mongodb.conf. could some one please help me. 
>
>
>
> $ModLoad imfile
> $InputFilePollInterval 10
> $WorkDirectory /var/spool/rsyslog
>
> # Input for mongod.log
> $InputFileName /var/log/mongodb/mongod.log
> $InputFileTag mongo
> $InputFileStateFile stat-mongo #this must be unique for each file being 
> polled
> $InputFileSeverity info
> $InputFilePersistStateInterval 20000
> $InputRunFileMonitor
>
> # Add a tag for file events
> $template GraylogMongo,"<%pri%>%protocol-version% 
> %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msgid% 
> [tag=\"mongo\"] %msg%\n"
>
> # Send to Loggly then discard
> if $programname == 'mongo' then @@10.40.10.11:20514;GraylogMongo
> if $programname == 'mongo' then ~
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Graylog Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/graylog2/e62ae4c6-8023-4693-bd98-27d7aa1ec970%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to