{"action":"created","issue":{"url":"https://api.github.com/repos/theangryangel/logstash-output-jdbc/issues/27","labels_url":"https://api.github.com/repos/theangryangel/logstash-output-jdbc/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/theangryangel/logstash-output-jdbc/issues/27/comments","events_url":"https://api.github.com/repos/theangryangel/logstash-output-jdbc/issues/27/events","html_url":"https://github.com/theangryangel/logstash-output-jdbc/issues/27","id":123564127,"number":27,"title":"Insert into multiple tables? ","user":{"login":"wroberts15","id":5678580,"avatar_url":"https://avatars.githubusercontent.com/u/5678580?v=3","gravatar_id":"","url":"https://api.github.com/users/wroberts15","html_url":"https://github.com/wroberts15","followers_url":"https://api.github.com/users/wroberts15/followers","following_url":"https://api.github.com/users/wroberts15/following{/other_user}","gists_url":"https://api.github.com/users/wroberts15/gists{/gist_id}","starred_url":"https://api.github.com/users/wroberts15/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wroberts15/subscriptions","organizations_url":"https://api.github.com/users/wroberts15/orgs","repos_url":"https://api.github.com/users/wroberts15/repos","events_url":"https://api.github.com/users/wroberts15/events{/privacy}","received_events_url":"https://api.github.com/users/wroberts15/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-22T22:00:11Z","updated_at":"2015-12-23T09:51:31Z","closed_at":null,"body":"Pretty simple question, however I'm stuck (maybe because it's the end of the day):\r\n\r\nBasically, can I have multiple statements or multiple \"INSERT INTO\"'s in one statement? Doesn't seem to be working for me right now. Below is my configuration (keep in mind that I have it working inserting into one table)\r\n\r\n```\r\nconnection_string => 'jdbc:sqlite:myexample.db'\r\nstatement => [ \"INSERT INTO req(filename, cval, querystring, datestring, ref_hash, ua_hash) VALUES(?,?,?,?,?,?); INSERT INTO reflookup(refhash,referrer) VALUES(?,?); INSERT INTO ualookup(uahash,useragent) VALUES(?,?);\", \"%{name}\", \"%{cval}\", \"%{querystring}\", \"%{datestring}\", \"%{refhash}\", \"%{uahash}\", \"%{refhash}\", \"%{ref}\", \"%{uahash}\", \"%{useragent}\"]\r\n```\r\n\r\nI apologize if I missed something in the README or something similar. \r\nBTW, great plugin it's been pretty simple and useful."},"comment":{"url":"https://api.github.com/repos/theangryangel/logstash-output-jdbc/issues/comments/166849832","html_url":"https://github.com/theangryangel/logstash-output-jdbc/issues/27#issuecomment-166849832","issue_url":"https://api.github.com/repos/theangryangel/logstash-output-jdbc/issues/27","id":166849832,"user":{"login":"theangryangel","id":309967,"avatar_url":"https://avatars.githubusercontent.com/u/309967?v=3","gravatar_id":"","url":"https://api.github.com/users/theangryangel","html_url":"https://github.com/theangryangel","followers_url":"https://api.github.com/users/theangryangel/followers","following_url":"https://api.github.com/users/theangryangel/following{/other_user}","gists_url":"https://api.github.com/users/theangryangel/gists{/gist_id}","starred_url":"https://api.github.com/users/theangryangel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theangryangel/subscriptions","organizations_url":"https://api.github.com/users/theangryangel/orgs","repos_url":"https://api.github.com/users/theangryangel/repos","events_url":"https://api.github.com/users/theangryangel/events{/privacy}","received_events_url":"https://api.github.com/users/theangryangel/received_events","type":"User","site_admin":false},"created_at":"2015-12-23T09:51:31Z","updated_at":"2015-12-23T09:51:31Z","body":"The statement parameter is assumed to be a single SQL command (at the moment), which isn't really particularly easy to workaround since most JDBC drivers will only permit a single SQL command in a prepared statement :disappointed: \r\n\r\nThat said, some JDBC drivers do have support for multiple queries - MySQL for example supports  allowMultiQueries=true in the connection string.\r\n\r\nI don't know of any parameter which would work for sqlite though.\r\n\r\nHowever, a workaround would be to have multiple JDBC outputs, using the same details but with 2 different statements. That should work without any problems, and without modifying the plugin. It's not ideal, but if you're generating your configuration dynamically then it wouldnt be much extra hassle."}}