1

I'm going mad. I'm trying to get rsyslog to send log files to logentries.com. This works perfectly until I try to log mysql-slow.log.

The config is pretty simple

module(load="imfile" PollingInterval="1") #needs to be done just once

# File 1     
input(type="imfile" File="/var/lib/mysql/mysql-slow.log"
Tag="mysql-slow"
Severity="notice"
StateFile="mysql-slow"
Facility="local7"
)

And if I delete the file, and write to it manually, I see the logs going out over tcp and arriving in logentries.com

However, if MySQL writes to the mysql-slow.log... nothing, at all. I've tried changing the permissions/users/groups, but that makes no difference. If I write something to that file using Vim, it's perfect, if mysql does... nothing.

I can't think of what possibly can be going wrong! Help!

Cheers

Alan

Alan Hollis
  • 181
  • 9
  • 1
    What if you do `mysqladmin flush-logs`? Perhaps it only sends to logentries.com on file close or something. And what if you put an inotify on it? Does it detect change when MySQL writes to it? – Halfgaar Nov 25 '14 at 19:16
  • Hmm not sure, I don't think flush-logs has anything to do with the the slow-query log. I tried both the inotify/polling methods as per http://www.rsyslog.com/doc/master/configuration/modules/imfile.html#module-parameters but neither made any difference. No change detected when mysql writes to it, but I can see the file getting bigger! Thanks for your response! – Alan Hollis Nov 25 '14 at 19:19
  • not to solve your problem, but maybe a workaround: parse the file with logstash and sent it to the service you need. – edlerd Nov 25 '14 at 22:26

0 Answers0