Stop writing to database in case of query error

General discussions here

Moderator: rgerhards

Google Ads


Stop writing to database in case of query error

Postby emilbart » Mon Jan 29, 2018 11:53 am

Hello,
I configured the rsyslogd to write some syslog messages to postresql database. Normally the configuration works as expected. But sometimes I get the following error during writing to database:
2018-01-29 11:31:05 CET db_name db_user ERROR: value too long for type character varying(32)
and rsyslog never stops writing that query but repeats the last query in the while loop. This causes that file logs for postresql grows to gigabytes.
Of course the problem is that the size of element in the database is too small. I would not like to increase it.
But is it possible to configure rsyslog to not repeat the SQL query in case of error?
My current configuration is as follows:
Code: Select all
$ModLoad ompgsql

$template SqlFormat,"insert into event (receivedat, devicereportedtime, Priority, Message) values ('%timegenerated:::date-rfc3339%', '%timereported:::date-rfc3339%', '%syslogseverity%', '%msg%')",SQL

$RepeatedMsgReduction off
$ActionQueueType LinkedList
$ActionQueueFileName dbq_file
$ActionQueueMaxDiskSpace 20m
$ActionQueueSaveOnShutdown on
$ActionQueueSyncQueueFiles on
$ActionResumeRetryCount 1
if ($syslogfacility-text == 'local1') then :ompgsql:127.0.0.1,db_name,db_user,db_pwd;SqlFormat



Thanks for any help.
emilbart
New
 
Posts: 4
Joined: Fri Jun 19, 2015 12:29 pm

Urgent Question?

  • Pulling out your Hair?
  • Wasting Time and Money?
  • Deadline Approaching?

Google Ads


Return to General

Who is online

Users browsing this forum: No registered users and 2 guests

cron