Closed rkhapre closed 7 years ago
Hi I am using Oracle DB I have below json value as coming from input and i want to insert this in Oracle DB
{ customer_id :1234: cust_name : abc cust_add: Japan }
My output parameters
output { jdbc { connection_string => "jdbc:oracle:thin:dc/dc@XXX.XX.X.XX1521:abcs" driver_jar_path => "F:/logstash-5.6.1/lib/ojdbc7.jar" statement => [ "INSERT INTO CUSTOMER(customer_id,cust_name,cust_add)VALUES(?,?,?)","customer_id","cust_name","cust_add"] } }
The above one inserts null records
output { jdbc { connection_string => "jdbc:oracle:thin:dc/dc@XXX.XX.X.XX1521:abcs" driver_jar_path => "F:/logstash-5.6.1/lib/ojdbc7.jar" statement => [ "INSERT INTO CUSTOMER(customer_id,cust_name,cust_add)VALUES(?,?,?)","%{customer_id}","%{cust_name}","%{cust_add}"] } }
The above one give error
Please let me know what will be the right insert query here to insert the value from input. I tried sprint format but it does not work. In the example conf file there is no traces of sprint format
add driver class mysql or oracle or something else like: driver_class => "com.mysql.jdbc.Driver"
I am using Oracle DB, i solved the problem by adding sprintf with double quotes. Closing this. Thanks
Hi I am using Oracle DB I have below json value as coming from input and i want to insert this in Oracle DB
My output parameters
The above one inserts null records
The above one give error
Please let me know what will be the right insert query here to insert the value from input. I tried sprint format but it does not work. In the example conf file there is no traces of sprint format