logstash-output-jdbc 5.0.0-java → 5.1.0-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/logstash/outputs/jdbc.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3679ee20a929262c59817ed15f61a851af854bd0
|
4
|
+
data.tar.gz: 9de7e02a4fb75b7c099a613f416bf6040fe43cec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
+
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
|