I configure my /etc/squid/squid.conf with the option: access_log syslog:LOG_LOCAL1. And my /etc/rsyslog.conf of two forms:
#1
$template mytemplate, "INSERT INTO access_log (msg) values ('%msg%')",sql
local1.* :ommysql:localhost,mydb,userdb,passdb;mytemplate
#
The insert is ok. All logs sending by squid are save in mysql
#2
$template mytemplate, "call myprocedure('%msg%')",sql
local1.* :ommysql:localhost,mydb,userdb,passdb;mytemplate
#
The procedure format the information and insert the data in other table.
My question is: not all data are save correctly. Some data are saved, others not.
I checked this enabling the log of transactions of mysql and I compared with the information save in the file access.log.
The rsyslog save the logs in access.log correctly, but not call the procedure all time.
Thanks for the help. Sorry for my poor english.