SQL om_dbi

Tags: #om_dbi

#1 Bohdan.Lisovskyi

Hi. How can I write SQL statement to the variable. For example: define variable $sql_statement = SELECT some_func() and in module om_dbi use this variable like Module om_dbi SQL $sql_statement Driver pgsql

#2 manuel.munozDeactivated Nxlog ✓
#1 Bohdan.Lisovskyi

Hi. How can I write SQL statement to the variable. For example: define variable $sql_statement = SELECT some_func() and in module om_dbi use this variable like Module om_dbi SQL $sql_statement Driver pgsql

Bohdan, You need to use im_dbi instead of om_dbi. Result of query cannot be save to a variable, but you can use output modules to write it to a file. ``` Module im_dbi Driver mysql Option host 127.0.0.1 Option username mysql Option password mysql Option dbname logdb SQL SELECT id, facility, severity, hostname, \ timestamp, application, message \ FROM log Module om_file File "tmp/output" Path dbi => file ```