logdna / logdna-agent

LogDNA Agent streams from log files to your LogDNA account. Works with Linux, Windows, and macOS Servers
https://logdna.com
MIT License
137 stars 55 forks source link

logdna-agent not bug in -f and not respecting filelist #224

Open amit777 opened 3 years ago

amit777 commented 3 years ago

There seems to be 2 bugs.. Not sure if they are related:

  1. logdna-agent -f /var/log/messages seems to not just monitor the single file, but rather all my logs within /var/log. It generates the following /etc/logdna.conf
    logdir   =  /var/log, /var/log/messages

    So it doesn't seem to set the right key, to logfile = [...]. It also is adding the top level /var/log folder which has a lot of log files in it.

I've tried to manually edit /etc/logdna.conf and restart the service, but no matter what I do, it seems to still pickup all the files.. ive tried the following:

logdir   = /var/log/messages
logfile   =  /var/log/messages
amit777 commented 3 years ago

I was able to figure out a workaround by playing with the source here.

logdir = /var/log/secure,/var/log/maillog,/var/log/haproxy.log,/var/log/redis.log,/var/log/cron,/var/log/yum.log,/var/log/fail2ban.log,/var/log/messages,/var/log/dnf*.log,/var/log/redis-local.log,/var/log/mongodb/mongo*.log,/var/log/audit/audit.log"

This seems to do that trick. The cli tool seems to stuff in /var/messages for some reason so I'm avoiding using that.