sqlite3 support

This is the place for developers to discuss bugs, new features and everything else about code changes.

Google Ads


sqlite3 support

Postby noggin143 » Sun Mar 02, 2008 9:14 pm

The sqlite3 support via libdbi required a number of changes and set ups using the 0.8.3 code base.

1. The sqlite3 libraries require an sqlite3_dbdir variable to be on the connection. There does not seem to be a mechanism for doing this via the parameter data in rsyslog.cond.

2. There is no sample creation script for the libdbi databases, so it was necessary to adapt one of the CreateDB scripts to support this. I ended up with

CREATE TABLE SystemEvents
(
ID serial primary key,
CustomerID bigint,
ReceivedAt timestamp without time zone NULL,
DeviceReportedTime timestamp without time zone NULL,
Facility smallint NULL,
Priority smallint NULL,
FromHost varchar(60) NULL,
Message text,
NTSeverity int NULL,
Importance int NULL,
EventSource varchar(60),
EventUser varchar(60) NULL,
EventCategory int NULL,
EventID int NULL,
EventBinaryData text NULL,
MaxAvailable int NULL,
CurrUsage int NULL,
MinUsage int NULL,
MaxUsage int NULL,
InfoUnitID int NULL ,
SysLogTag varchar(60),
EventLogType varchar(60),
GenericFileName VarChar(60),
SystemID int NULL
);
noggin143
New
 
Posts: 4
Joined: Sun Mar 02, 2008 8:43 pm

Urgent Question?

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

RE: sqlite3 support

Postby rgerhards » Mon Mar 03, 2008 7:55 am

Hi,

thanks for the script, will add that to the contrib directory. In regard to #1, do I correctly understand that a new configuration variable is needed? Or did you solve the problem somehow (I have to admit I did not clearly understand that part). Please note that I do not have sqlite available in my lab, so I am depending on user reports like yours (and appreciate them very much :)).

Rainer
rgerhards
Site Admin
 
Posts: 3252
Joined: Thu Feb 13, 2003 11:57 am

Postby noggin143 » Mon Mar 03, 2008 9:27 am

I think that a new variable would be the cleanest way to fix the problem. I temporarily solved it by adding (along with the dbname set_options)

dbi_conn_set_option(pData->conn, "sqlite3_dbdir", "/tmp");

This could be solved by adding a new .conf variable

$actionLibDbiDbdir

and making it so that the sqlite3_dbdir is set to this value if defined.

It is unfortunate that there does not seem to be a way with libdbi to make a default sqlite3 db directory.
noggin143
New
 
Posts: 4
Joined: Sun Mar 02, 2008 8:43 pm

Postby rgerhards » Mon Mar 03, 2008 9:29 am

OK, I will log this as an enhancement request and see that it is done when I am finished with the next major step I am currently working on. Shouldn't be a big deal. Thanks for pointing out :)

Rainer
rgerhards
Site Admin
 
Posts: 3252
Joined: Thu Feb 13, 2003 11:57 am

Google Ads



Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 0 guests

cron