Hi there,<br><br> Okay, looks like I was looking/thinking about something else, so lets explain my problem.<br><br> I want the pid inseted to be a "proper" number/integer, not a string/character, and the fun starts with several of my sources not having a pid entry, thus that field I would like to be filled with NULL values. However, it still gets escaped, and when it gets escaped, the NULL is not null anymore, but the string 'NULL' :(<br>
<br> I was hoping that in some why I could coerce syslog-ng to understand
that that column is a integer column, thus should not be escaped as it
is currently done ;(<br>
<br>I have the following destination:<br>destination d_pgsql {<br> sql(type(pgsql)<br> host("127.0.0.1") username("logwriter") password("logwriter") port("5432")<br> database("syslog")<br>
table("logs_${HOST}_${R_YEAR}${R_MONTH}${R_DAY}") #or whatever you want, example ${HOST}" for hosts, ${LEVEL}" for levels.. etc<br> columns("datetime varchar(16)", "host varchar(32)", "program varchar(16)", "pid varchar(8) default null", "message varchar")<br>
values("$R_DATE", "$HOST", "$PROGRAM", "${PID:-NULL}", "$MSG")<br> indexes("datetime", "host", "program", "pid", "message"));<br>
};<br><br>and the following log lines:<br><br>Incoming log entry; line='<166>Feb 22 08:38:59 Vpxa: [2011-02-22 08:38:59.862 1B7A7B90 verbose \'App\'] [VpxaHalServices] HostChanged Event Fired, properties changed []'<br>
Running SQL query; query='INSERT INTO logs_somedevice_20110222 (datetime, host, program, pid, message) VALUES (\'Feb 22 11:39:27\', \'somedevice\', \'Vpxa\', \'NULL\', \'[2011-02-22 08:38:59.862 1B7A7B90 verbose \'\'App\'\'] [VpxaHalServices] HostChanged Event Fired, properties changed []\')'<br>
<br>