Exclude type of logs

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Exclude type of logs

Post by WillemDH »

Hello,

This is the rsyslog config create by NLS when adding a Linux server:

Code: Select all

### Begin forwarding rule for Nagios Log Server                           NAGIOSLOGSERVER
$WorkDirectory /var/lib/rsyslog # Where spool files will live             NAGIOSLOGSERVER
$ActionQueueFileName nlsFwdRule0 # Unique name prefix for spool files     NAGIOSLOGSERVER
$ActionQueueMaxDiskSpace 1g   # 1GB space limit (use as much as possible) NAGIOSLOGSERVER
$ActionQueueSaveOnShutdown on # Save messages to disk on shutdown         NAGIOSLOGSERVER
$ActionQueueType LinkedList   # Use asynchronous processing               NAGIOSLOGSERVER
$ActionResumeRetryCount -1    # Infinite retries if host is down          NAGIOSLOGSERVER
# Remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional       NAGIOSLOGSERVER
*.* @@log01:10546                                               # NAGIOSLOGSERVER
### End of Nagios Log Server forwarding rule                              NAGIOSLOGSERVER
My problem is that /var/log/messages contains a type of messages I don't want to send to NLS, as it contains 6k messages / second... (influx stack)

How can I exclude all messages in /var/log/messages with the format:

Code: Select all

Dec  7 16:33:19 grafana influxd: [httpd] 10.23.17.50 - InWriter [07/Dec/2016:16:33:19 +0100] "POST /write?consistency=&db=db_telegraf_win_01&precision=ns&rp= HTTP/1.1" 204 0 "-" "telegraf" 7ae3b145-bcp2-11e6-9fe0-000000000000 19890
Tx
Nagios XI 5.8.1
https://outsideit.net
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Exclude type of logs

Post by mcapra »

Is it absolutely necessary to send the influx events to /var/log/messages? It would be much easier to have rsyslog separate those events into their own file.

You can do regex matches against all /var/log/messages events, but redirecting the influxd events to their own file would be much less work for the CPU.
Former Nagios employee
https://www.mcapra.com/
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Exclude type of logs

Post by WillemDH »

I'll see if it's possible to configure a separate log for these influx posts.
Nagios XI 5.8.1
https://outsideit.net
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Exclude type of logs

Post by dwhitfield »

Please let us know if you need any additional help. We await your results! :)
Locked