[rsyslog-notify] Forum Thread: rsyslog.conf call omlibdbi beginTransaction entry point - (Mode 'post')

noreply at adiscon.com noreply at adiscon.com
Tue Nov 24 17:40:57 CET 2015


User: srowens 
Forumlink: http://kb.monitorware.com/viewtopic.php?p=26189#p26189

Message: 
----------
Hi,

My task was to get rsyslog to insert syslog events into an oracle database.
I compiled the libdbi-drivers-0.9.0 oracle source code dbd_oracle.c against
Oracle InstantClient 12.1.0.2.0.
Then I compiled libdbi-0.9.0 with the new oracle dbd driver
.../lib/dbd/libdbdoracle.so
Before integrating libdbi-0.9.0  libdbi.so and libdbdoracle.so with
rsyslog, I created a libdbi test client
The test client connects to the oracle database successfully with
dbi_conn_connect.
The test cleint performed an insert with dbi_conn_query.
However, since oracle does not have auto commit, I had to add 
dbi_conn_query(conn, "commit"); for oracle to comit the insert.
That proved to me that the newly compiled libdbi-0.9.0 with the oracle
driver was functional.

Next I compiled rsyslog-7.6.7 with my libdbi-0.9.0 and oracle driver and
tested with the below relevant portions of rsyslog.conf:
#### MODULES ####
module(load="omlibdbi")

template(name="myOracleInsert" type="list" option.sql="on") {
constant(value="INSERT INTO MY_TABLE (TRANS_DATE) VALUES (TO_TIMESTAMP(")
property(name="timereported" dateFormat="mysql")
constant(value="', 'YYYYMMDDHH24:MI:SS')))")

#### RULES ####
local1.*   action (type="omlibdbi" driver="oracle" server="xxx" db="MYDB"
uid="my_user" pwd="xxx" template="myOracleInsert")

With tcpdump I can see that a connection is made to the oracle database and
that a correct insert statement is also sent to the db, so I know that
rsyslog is functioning with the new omlibdbi and oracle driver.

I'm back at solving oracle's lack of auto commit.

Is there any way to explicitly call omlibdbi's beginTransaction entry point
before omlibdbi's doAcation followed  omlibdbi's  endTransaction from
rsyslog.conf for the action above?

Thanks,
Stephen Owens
email: <!-- e --><a
href="mailto:stephen.owens at state.ma.us">stephen.owens at state.ma.us</a><!-- e
-->


More information about the rsyslog-notify mailing list