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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98f8f8ec2eabfa0a313b967c55e70d3746877d1f
4
- data.tar.gz: 4176e942c025b4ad292b2ad611bf975e343da133
3
+ metadata.gz: 136a9e59dadead66c0b3aa3b4ae87b194a66778d
4
+ data.tar.gz: a53165aa0c81c5f945d2c7776e9c6ad01ed528e0
5
5
  SHA512:
6
- metadata.gz: 69e000bfc928a3cdcbdcfff5a70088e88ba0445dd57ad411ee9af98051bb1e31c9de9ce3c325f46aea568a9fe9e77854a7dc53beb65c833f6b09d40edfd66bc4
7
- data.tar.gz: 17ca8bf92beae6a3f7c8c3e3de00d73b9d3ef6a39211a60f5c2927b6c13f92f7965de2c4da40fe7f8c038a532ef6ac7022831355ef9308ced1e4ff952309f71b
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
- This is reportedly working, according to [@db2882](https://github.com/db2882) in issue #20.
143
- No example configuration provided.
144
- If you have a working sample, pull requests are welcome.
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 - No longer required
16
- config :driver_class, :obsolete => "driver_class is no longer required and can be removed from your configuration"
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.1
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-22 00:00:00.000000000 Z
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: '0'
112
+ version: 1.3.1
113
113
  requirements: []
114
114
  rubyforge_project:
115
115
  rubygems_version: 2.0.14