On Fri, 2013-04-05 at 12:17 +0200, Ana Gallardo Gómez wrote:
> Hello,
> 
> this is my first messge to the list. I'm using debian:
> 
> # uname -a
> Linux lw06 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64
> GNU/Linux
> 
> # mysql --version
> mysql  Ver 14.14 Distrib 5.1.63, for debian-linux-gnu (x86_64) using
> readline 6.1
> 
> # rsyslogd -v
> rsyslogd 4.6.4, compiled with:

That's a very old version, but probably good enough for what you want to
do.

>     FEATURE_REGEXP:                Yes
>     FEATURE_LARGEFILE:            No
>     FEATURE_NETZIP (message compression):    Yes
>     GSSAPI Kerberos 5 support:        Yes
>     FEATURE_DEBUG (debug build, slow code):    No
>     Atomic operations supported:        Yes
>     Runtime Instrumentation (slow code):    No
> 
> See http://www.rsyslog.com for more information.
> 
> 
> I would like to filñter mysql syslog messages, so I have this configuration
> file:
> 
> root@lw06:/home/cau1# cat /etc/rsyslog.d/mysql.conf
> #Cuando el nombre del programa que genera el log contenga "mysql" lo envías
> al fichero...
> if $programname == 'msqld' or $msg contains 'mysql' then
> -/var/log/mysql/mysql.log
> #y luego lo tiras
> & ~
> 
This looks correct, but most probably is at the wrong place in
rsyslog.conf. It needs to be above the rule for /var/log/syslog.

If you post your complete config, we can help you sort this out.

Rainer
> 
> When I, for example, restart mysql, my log in /var/log/mysql/mysql.log is:
> 
> # tail -f /var/log/mysql/mysql.log
> ...
> Apr  5 11:59:09 lw06 mysqld: 130405 11:59:09 [Note] /usr/sbin/mysqld:
> Normal shutdown
> Apr  5 11:59:16 lw06 mysqld: 130405 11:59:16 [Note] /usr/sbin/mysqld:
> Shutdown complete
> Apr  5 11:59:16 lw06 mysqld_safe: mysqld from pid file
> /var/run/mysqld/mysqld.pid ended
> Apr  5 11:59:17 lw06 mysqld_safe: Starting mysqld daemon with databases
> from /var/lib/mysql
> Apr  5 11:59:17 lw06 mysqld: 130405 11:59:17 [Note] /usr/sbin/mysqld: ready
> for connections.
> Apr  5 11:59:17 lw06 mysqld: Version: '5.1.63-0+squeeze1-log'  socket:
> '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
> Apr  5 11:59:18 lw06 /etc/mysql/debian-start[1576]: /usr/bin/mysql_upgrade:
> the '--basedir' option is always ignored
> Apr  5 11:59:18 lw06 /etc/mysql/debian-start[1576]: Looking for 'mysql' as:
> /usr/bin/mysql
> Apr  5 11:59:18 lw06 /etc/mysql/debian-start[1576]: Looking for
> 'mysqlcheck' as: /usr/bin/mysqlcheck
> Apr  5 11:59:18 lw06 /etc/mysql/debian-start[1576]: This installation of
> MySQL is already upgraded to 5.1.63, use --force if you still need to run
> mysql_upgrade
> ...
> 
> 
> But, but there are lines that are not removed from /var/log/syslog file:
> 
> # tail -f /var/log/syslog
> Apr  5 11:59:16 lw06 mysqld:
> Apr  5 11:59:17 lw06 mysqld: 130405 11:59:17 [Warning] '--log_slow_queries'
> is deprecated and will be removed in a future release. Please use
> ''--slow_query_log'/'--slow_query_log_file'' instead.
> Apr  5 11:59:17 lw06 mysqld: 130405 11:59:17 [Note] Plugin 'FEDERATED' is
> disabled.
> Apr  5 11:59:17 lw06 mysqld: 130405 11:59:17  InnoDB: Initializing buffer
> pool, size = 8.0M
> Apr  5 11:59:17 lw06 mysqld: 130405 11:59:17  InnoDB: Completed
> initialization of buffer pool
> Apr  5 11:59:17 lw06 mysqld: 130405 11:59:17  InnoDB: Started; log sequence
> number 0 44253
> Apr  5 11:59:17 lw06 mysqld: 130405 11:59:17 [Note] Event Scheduler: Loaded
> 0 events
> Apr  5 11:59:18 lw06 /etc/mysql/debian-start[1573]: Upgrading MySQL tables
> if necessary.
> Apr  5 11:59:18 lw06 /etc/mysql/debian-start[1583]: Checking for insecure
> root accounts.
> Apr  5 11:59:18 lw06 /etc/mysql/debian-start[1587]: Triggering
> myisam-recover for all MyISAM tables
> 
> Can somebody help me?
> 
> Thank you very much and sorry for my english.
> _______________________________________________
> rsyslog mailing list
> http://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com/professional-services/
> What's up with rsyslog? Follow https://twitter.com/rgerhards
> NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
> sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T 
> LIKE THAT.

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to