[syslog-ng] Database field types -- insert fails for null values
Balazs Scheidler
bazsi at balabit.hu
Tue Mar 17 13:43:42 CET 2009
On Sun, 2009-03-15 at 14:40 -0700, Liam Kirsher wrote:
> This worked fine for the timestamps, but there was a problem with other
> types.
>
> Some of the numeric fields can have null values.
>
> It looks like syslog-ng doesn't translate empty strings into nulls when
> doing the insert. Thus, the insert fails because the numeric field
> types won't accept a string of any kind.
>
> For now, I can just let them be text strings, but I'd prefer to be able
> to use numeric types and allow null values. For example, in the
> destination below, lat and long could be float8 and pid and art_id could
> be integers.
true enough, but you could perhaps use the "default value" feature of
macro expansion, like this:
${art_id:-0}
this means that if art_id is unset it'll expand to 0. Is this a solution
to your problem?
--
Bazsi
More information about the syslog-ng
mailing list