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 uselogging
, but I can see traffic when I connect withmysql
, whether I get the password right or not.
This is on CentOS 6.5 with rsyslog 5.8.10.