Hi:
I am processing my own logfile and then write out to a target file. That part seems to work ok. I am using following template conditional property replacement
$template Testlog,"%msg%\n"
if $syslogfacility-text == 'local5' and $syslogtag == 'msglog:' and not ($msg contains 'ENDOFFILE') then /var/log/testlog.1;Testlog
I am having problem with regex working correctly in the database insert template:
I created a template for recording a logfile msg to mysql. The template is:
template dbFormat,"insert into SystemEvents (Message,Facility, Priority, DeviceReportedTime,RecievedAt, InfoUnitID,SysLogTag) values('%msg:R,ERE,0,FIELD:[^$][^ENDOFFILE]*--end%', %syslogfacility%, '%HOSTNAME%','%syslogpriority%, '%timereported:::data-mysql%','%timegenerated:::date-mysql%',%iut%,'%syslogtag%')",sql
I also enabled imfile module. I trying to match '$$$$ ENDOFFILE' string from msg and not inserted into database if match is found otherwise I want to print the field as is. I checked the regex syntax with the property replacer tool. It seem to do what I want. But when i try to run it from the mysql.conf file, the regex works sometimes and other times it does not. What should I look for?


