Ok, this is from my database template I am using, so here is the template:
$template db,"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag, delay, dsn) values ('%msg%', %syslogfacility%, '%HOSTNAME%', %syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%', '%msg:R,ERE,1,FIELD:delay=([0-9]+\.[0-9])--end%', '%msg:R,ERE,1,FIELD:dsn=([0-9]+\.[0-9]+\.[0-9])--end%')",sql
As you can see, I am using reg-exp to pull digits for two fields in my DB, here is what it looks like in the db.
*************************** 1018. row ***************************
ID: 1018
CustomerID: NULL
ReceivedAt: 2008-11-10 15:40:02
DeviceReportedTime: 2008-11-10 15:40:02
Facility: 2
Priority: 6
FromHost: staging
Message: 53F631500C5: to=<doug@bronto.com>, relay=aspmx.l.google.com[209.85.163.27]:25, delay=1.5, delays=0.16/0.06/0.43/0.82, dsn=2.0.0, status=sent (250 2.0.0 OK 1226349602 z26si15368276ele.7)
NTSeverity: NULL
Importance: NULL
EventSource: NULL
EventUser: NULL
EventCategory: NULL
EventID: NULL
EventBinaryData: NULL
MaxAvailable: NULL
CurrUsage: NULL
MinUsage: NULL
MaxUsage: NULL
InfoUnitID: 1
SysLogTag: brontostaging/smtp[25260]:
EventLogType: NULL
GenericFileName: NULL
SystemID: NULL
dsn: 2.0.0
delay: 1.5
*************************** 1019. row ***************************
ID: 1019
CustomerID: NULL
ReceivedAt: 2008-11-10 15:40:02
DeviceReportedTime: 2008-11-10 15:40:02
Facility: 2
Priority: 6
FromHost: staging
Message: 53F631500C5: removed
NTSeverity: NULL
Importance: NULL
EventSource: NULL
EventUser: NULL
EventCategory: NULL
EventID: NULL
EventBinaryData: NULL
MaxAvailable: NULL
CurrUsage: NULL
MinUsage: NULL
MaxUsage: NULL
InfoUnitID: 1
SysLogTag: brontostaging/qmgr[24531]:
EventLogType: NULL
GenericFileName: NULL
SystemID: NULL
dsn: 53F631500
delay: 53F631500
1019 rows in set (0.01 sec)
mysql>
As you can see in the first part of the query, row 1018, the dsn and delay fields are properly populated, but in the second part of the query, it is putting part of the message id in dsn and delay, which I don't think rsyslog should be doing, but I very well could be wrong on that. Again, here is a complete postfix maillog I am using to test against.
Nov 10 15:40:05 staging brontostaging/pickup[22709]: 53F631500C5: uid=602 from=<doug>
Nov 10 15:40:05 staging brontostaging/cleanup[25256]: 53F631500C5: message-id=<20081110204005.53F631500C5@email.brown-house.net>
Nov 10 15:40:05 staging brontostaging/qmgr[24531]: 53F631500C5: from=<doug@email.brown-house.net>, size=336, nrcpt=1 (queue active)
Nov 10 15:40:06 staging brontostaging/smtp[25260]: 53F631500C5: to=<doug@bronto.com>, relay=aspmx.l.google.com[209.85.163.27]:25, delay=1.5, delays=0.16/0.06/0.43/0.82, dsn=2.0.0, status=sent (250 2.0.0 OK 1226349602 z26si15368276ele.7)
Nov 10 15:40:06 staging brontostaging/qmgr[24531]: 53F631500C5: removed


