Out of the box rsyslog will dump everything into the
SystemEvents table within the `Syslog database (if you use the default schema provided). I would like to use a regular expression to filter inbound messages into separate database tables.
I've played with this, but I'm having a hard time figuring out the best way to accomplish this (or even a way that functions).
In my rsyslog.conf:
$template wireless, \ "insert into RogueAPs \ (ReceivedAt, DeviceReportedTime, Facility, Priority, FromHost, Message) \ VALUES('%timegenerated%', '%timereported%', '%syslogfacility%', '%syslogpriority%', '%fromhost-ip%', '%msg%');", \ stdsql if $msg contains 'subtype=wireless' then :ommysql:127.0.0.1,Syslog,dbusername,dbpassword;wireless *.* :ommysql:127.0.0.1,Syslog,dbusername,dbpassword
This was my latest attempt, but I'm stuck.
(the RogueAPs table is just a clone of the default SystemEvents table that ships with rsyslog)
shell# /usr/local/sbin/rsyslogd -v rsyslogd 5.5.5, compiled with: FEATURE_REGEXP: Yes FEATURE_LARGEFILE: No FEATURE_NETZIP (message compression): Yes GSSAPI Kerberos 5 support: No FEATURE_DEBUG (debug build, slow code): No Atomic operations supported: Yes Runtime Instrumentation (slow code): No See http://www.rsyslog.com for more information.