0

I'm trying to connect rsyslog to a remote SQL database. Here's (part of) my /etc/rsyslog.conf:

$ModLoad ommysql
*.* action(type="ommysql" server="logs.example.com" serverport="3306" db="logs" uid="..." pwd="...")

I can send logging messages to the terminal and /var/log/messages by doing logger -s "test message", but they don't appear in the database. I have installed rsyslog-mysql and mysql is installed on the machine as well. Here's what I've tried so far:

  • I looked in /var/log/messages after restarting rsyslog to see if it was failing to start or to parse the config file (it's doing fine).
  • I connected to the database using the mysql command - the user exists and can connect to the server, and it has the right permissions.
  • I used tcpdump to listen to traffic going to port 3306. There is none when I use logging, but I can see traffic when I connect with mysql, whether I get the password right or not.

This is on CentOS 6.5 with rsyslog 5.8.10.

zrneely
  • 1,802
  • 3
  • 17
  • 26

1 Answers1

0

It turns out I was using the "new style" configuration (used on rsyslog v6+), but the version of rsyslog I had installed was 5.8.10. I changed the *.* line to the following (the old style):

*.* :ommysql:logs.example.com,logs,rsyslogger,password

and it worked.

zrneely
  • 1,802
  • 3
  • 17
  • 26