logstash-output-jdbc 0.2.1 → 0.2.2.rc1
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 +34 -3
- data/lib/logstash/outputs/jdbc.rb +9 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 136a9e59dadead66c0b3aa3b4ae87b194a66778d
|
4
|
+
data.tar.gz: a53165aa0c81c5f945d2c7776e9c6ad01ed528e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3034d07b2ce2bcc743eca63d5311903b52c57b103aab548c6840b67608413fdb87efed6abf86228b81c37a0c48ba61002b4519137b60a463bc3c9d20acaba762
|
7
|
+
data.tar.gz: 9e54e34966849f7bf8bd39f6ae8a603ea391da685ba840c09a045c7d3ab70be7374167a931826bbc4f822d9b512f54abb85c1c4ba1efe72755103f28ac96387c
|
data/README.md
CHANGED
@@ -41,6 +41,8 @@ Tests are not yet 100% complete.
|
|
41
41
|
|
42
42
|
| Option | Type | Description | Required? | Default |
|
43
43
|
| ------ | ---- | ----------- | --------- | ------- |
|
44
|
+
| driver_class | String | Specify a driver class if autoloading fails | No | |
|
45
|
+
| driver_auto_commit | Boolean | If the driver does not support auto commit, you should set this to false | No | True |
|
44
46
|
| driver_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
47
|
| connection_string | String | JDBC connection URL | Yes | |
|
46
48
|
| username | String | JDBC username - this is optional as it may be included in the connection string, for many drivers | No | |
|
@@ -139,6 +141,35 @@ output {
|
|
139
141
|
```
|
140
142
|
|
141
143
|
### MariaDB
|
142
|
-
|
143
|
-
|
144
|
-
|
144
|
+
* Tested with Ubuntu 14.04.3 LTS, Server version: 10.1.9-MariaDB-1~trusty-log mariadb.org binary distribution
|
145
|
+
* Tested using https://downloads.mariadb.com/enterprise/tqge-whfa/connectors/java/connector-java-1.3.2/mariadb-java-client-1.3.2.jar (mariadb-java-client-1.3.2.jar)
|
146
|
+
```
|
147
|
+
input
|
148
|
+
{
|
149
|
+
stdin { }
|
150
|
+
}
|
151
|
+
output {
|
152
|
+
jdbc {
|
153
|
+
connection_string => "jdbc:mariadb://HOSTNAME/DATABASE?user=USER&password=PASSWORD"
|
154
|
+
statement => [ "INSERT INTO log (host, timestamp, message) VALUES(?, ?, ?)", "host", "@timestamp", "message" ]
|
155
|
+
}
|
156
|
+
|
157
|
+
}
|
158
|
+
```
|
159
|
+
|
160
|
+
### Apache Phoenix (HBase SQL)
|
161
|
+
* Tested with Ubuntu 14.04.03 / Logstash 2.1 / Apache Phoenix 4.6
|
162
|
+
* <!> HBase and Zookeeper must be both accessible from logstash machine <!>
|
163
|
+
```
|
164
|
+
input
|
165
|
+
{
|
166
|
+
stdin { }
|
167
|
+
}
|
168
|
+
output {
|
169
|
+
jdbc {
|
170
|
+
connection_string => "jdbc:phoenix:ZOOKEEPER_HOSTNAME"
|
171
|
+
statement => [ "UPSERT INTO EVENTS log (host, timestamp, message) VALUES(?, ?, ?)", "host", "@timestamp", "message" ]
|
172
|
+
}
|
173
|
+
|
174
|
+
}
|
175
|
+
```
|
@@ -12,8 +12,11 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
|
|
12
12
|
|
13
13
|
config_name "jdbc"
|
14
14
|
|
15
|
-
# Driver class -
|
16
|
-
config :driver_class, :
|
15
|
+
# Driver class - Reintroduced for https://github.com/theangryangel/logstash-output-jdbc/issues/26
|
16
|
+
config :driver_class, :validate => :string
|
17
|
+
|
18
|
+
# Does the JDBC driver support autocommit?
|
19
|
+
config :driver_auto_commit, :validate => :boolean, :default => true, :required => true
|
17
20
|
|
18
21
|
# Where to find the jar
|
19
22
|
# Defaults to not required, and to the original behaviour
|
@@ -81,6 +84,10 @@ class LogStash::Outputs::Jdbc < LogStash::Outputs::Base
|
|
81
84
|
load_jar_files!
|
82
85
|
|
83
86
|
@pool = Java::ComZaxxerHikari::HikariDataSource.new
|
87
|
+
|
88
|
+
@pool.setAutoCommit(@driver_auto_commit)
|
89
|
+
@pool.setDriverClassName(@driver_class) if @driver_class
|
90
|
+
|
84
91
|
@pool.setJdbcUrl(@connection_string)
|
85
92
|
|
86
93
|
@pool.setUsername(@username) if @username
|
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: 0.2.
|
4
|
+
version: 0.2.2.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- the_angry_angel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core
|
@@ -107,9 +107,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
107
|
version: '0'
|
108
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
109
|
requirements:
|
110
|
-
- - '
|
110
|
+
- - '>'
|
111
111
|
- !ruby/object:Gem::Version
|
112
|
-
version:
|
112
|
+
version: 1.3.1
|
113
113
|
requirements: []
|
114
114
|
rubyforge_project:
|
115
115
|
rubygems_version: 2.0.14
|