[syslog-ng] SQL destination - inserting data into ARRAY column

Gergely Nagy algernon at balabit.hu
Wed Apr 2 14:27:14 CEST 2014


Tomáš Novosad <tomas.novosad at linuxbox.cz> writes:

> Problems comes when i try to insert such data via syslog.
> My perl program produces this line which is sent to syslog:
> parts="(part1,20,bla),(part2,234,bli)"
> this is again parsed into macro and macro is again surronded by brackets.
> So syslog tries to insert this
> '{(part1,20,bla),(part2,234,bli)}'
> which fails because target column if of type part_data[], but postgres parses the string as text[].
> Therfore i need to explicitly instruct postgres to do a data conversion.
> This can be easily achieved by adding the conversion to input string
> '{(part1,20,bla),(part2,234,bli)}'::part_data[]
>
> however i do no know how to achieve this, as the literal text
> '::part_data[]' is just outside the single qutes.
> I just do not know how to instruct syslog-ng to add extra text
> ::part_data[]
> just after the last single quote.
> All the inserted values are simple strings and i do not know how to add some extramodifications to that strings.
>
> Is there any way to do such thing?

Not currently, but once we have type hinting support added to the SQL
destination, it will be possible to do what you wish. But that's
syslog-ng 3.6+ material, I'm afraid.

-- 
|8]



More information about the syslog-ng mailing list