logstash-output-jdbc 5.0.0-java → 5.1.0-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 727a931f9b189e29d515b0798e010f276f5def1f
4
- data.tar.gz: ed78ddac198f7eb2411da80c51893d44bd6fd52b
3
+ metadata.gz: 3679ee20a929262c59817ed15f61a851af854bd0
4
+ data.tar.gz: 9de7e02a4fb75b7c099a613f416bf6040fe43cec
5
5
  SHA512:
6
- metadata.gz: 7176a744ec917960465f5c874eeb0f81ede3c89f442822f391b898326004ff92d274e6c08dd7312b26f224a72f353be1e91130200a722642b03fc1c96ca14061
7
- data.tar.gz: f7597c9e0cf41ad3417ba26d316cfea0e0a9533f2e387f73578dc87e33e6041caedac209bb03e7fe05e2f9dfbf894d0cc749e626f7616ecd9309b866337f7125
6
+ metadata.gz: a49ce2b72f49a1b49d2b7f2f57e051c18ad2510f4b5cbb2a8fa15890ae8171943b5d841bdc11a748496557510e6d2ca11769bb0799250d4d5a0d87cace190aff
7
+ data.tar.gz: f1cb48d1eec8a3cbd6758bdc2fa3b2762788f3031a11ad6d37e67c7a461aba38f447401531dd307c7e323c4310e0359976b8b11b6b57fdcd018143abb696b89d
data/README.md CHANGED
@@ -44,6 +44,7 @@ For development:
44
44
  | driver_jar_path | String | File path to jar file containing your JDBC driver. This is optional, and all JDBC jars may be placed in $LOGSTASH_HOME/vendor/jar/jdbc instead. | No | |
45
45
  | connection_string | String | JDBC connection URL | Yes | |
46
46
  | connection_test | Boolean | Run a JDBC connection test. Some drivers do not function correctly, and you may need to disable the connection test to supress an error. Cockroach with the postgres JDBC driver is such an example. | No | Yes |
47
+ | connection_test_query | String | Connection test and init query string, required for some JDBC drivers that don't support isValid(). Typically you'd set to this "SELECT 1" | No | |
47
48
  | username | String | JDBC username - this is optional as it may be included in the connection string, for many drivers | No | |
48
49
  | password | String | JDBC password - this is optional as it may be included in the connection string, for many drivers | No | |
49
50
  | statement | Array | An array of strings representing the SQL statement to run. Index 0 is the SQL statement that is prepared, all other array entries are passed in as parameters (in order). A parameter may either be a property of the event (i.e. "@timestamp", or "host") or a formatted string (i.e. "%{host} - %{message}" or "%{message}"). If a key is passed then it will be automatically converted as required for insertion into SQL. If it's a formatted string then it will be passed in verbatim. | Yes | |
@@ -86,6 +86,10 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
86
86
  # Run a connection test on start.
87
87
  config :connection_test, validate: :boolean, default: true
88
88
 
89
+ # Connection test and init string, required for some JDBC endpoints
90
+ # notable phoenix-thin - see logstash-output-jdbc issue #60
91
+ config :connection_test_query, validate: :string, required: false
92
+
89
93
  # Maximum number of sequential failed attempts, before we stop retrying.
90
94
  # If set to < 1, then it will infinitely retry.
91
95
  # At the default values this is a little over 10 minutes
@@ -146,6 +150,11 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
146
150
 
147
151
  validate_connection_timeout = (@connection_timeout / 1000) / 2
148
152
 
153
+ if !@connection_test_query.nil? and @connection_test_query.length > 1
154
+ @pool.setConnectionTestQuery(@connection_test_query)
155
+ @pool.setConnectionInitSql(@connection_test_query)
156
+ end
157
+
149
158
  return unless @connection_test
150
159
 
151
160
  # Test connection
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-output-jdbc
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.1.0
5
5
  platform: java
6
6
  authors:
7
7
  - the_angry_angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-03 00:00:00.000000000 Z
11
+ date: 2016-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement