logstash-output-charrington 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/logstash/outputs/charrington.rb +10 -4
- data/logstash-output-charrington.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc7913c9e276dc1f40fa722cb271f21d0e19ab3270b7fbd854cc7057c6a50bc3
|
4
|
+
data.tar.gz: 4be9c45b7e08e2ef3ab84b07109096305cfcc33a84b3cc9625292d8e572bf86b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13ed00f23566b13bd75c3935154d0c57336fe0be4e5ea1f80a0a529b068468159863fcd564e4f0ce730645d2a8ffe49d467f86fa6c0addd8b7fa8ac8b525e45a
|
7
|
+
data.tar.gz: 242d0f1f8174e627f45d32924f7864d78969cb92f2f20141b9311a02e5d1cb329c9c4b13b62b79c60bb252df0df3fdb0d4eeed492609ddc0ba2e00d4a1176739
|
data/README.md
CHANGED
@@ -63,6 +63,7 @@ For development:
|
|
63
63
|
| retry_sql_states | Array of strings | An array of custom SQL state codes you wish to retry until `max_flush_exceptions`. Useful if you're using a JDBC driver which returns retry-able, but non-standard SQL state codes in it's exceptions. | No | [] |
|
64
64
|
| event_as_json_keyword | String | The magic key word that the plugin looks for to convert the entire event into a JSON object. As Logstash does not support this out of the box with it's `sprintf` implementation, you can use whatever this field is set to in the statement parameters | No | @event |
|
65
65
|
| enable_event_as_json_keyword | Boolean | Enables the magic keyword set in the configuration option `event_as_json_keyword`. Without this enabled the plugin will not convert the `event_as_json_keyword` into JSON encoding of the entire event. | No | False |
|
66
|
+
| schema | String | Database schema | No | False |
|
66
67
|
|
67
68
|
## Example configurations
|
68
69
|
Example logstash configurations, can now be found in the examples directory. Where possible we try to link every configuration with a tested jar.
|
@@ -107,6 +107,9 @@ class LogStash::Outputs::Charrington < LogStash::Outputs::Base
|
|
107
107
|
# The magic key used to convert the whole event to JSON. If you need this, and you have the default in your events, you can use this to change your magic keyword.
|
108
108
|
config :event_as_json_keyword, validate: :string, default: '@event'
|
109
109
|
|
110
|
+
# The database schema
|
111
|
+
config :schema, validate: :string, default: ''
|
112
|
+
|
110
113
|
def register
|
111
114
|
@logger.info('JDBC - Starting up')
|
112
115
|
|
@@ -214,10 +217,13 @@ class LogStash::Outputs::Charrington < LogStash::Outputs::Base
|
|
214
217
|
end
|
215
218
|
|
216
219
|
def create_table_name(event)
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
220
|
+
raise TableNameNil.new("Table name is nil", event) if event.nil?
|
221
|
+
|
222
|
+
event = event.to_hash["event"].to_s.strip
|
223
|
+
raise TableNameNil.new("Table name is nil", event) if event.empty?
|
224
|
+
|
225
|
+
schema = @schema.empty? ? '' : "#{@schema}."
|
226
|
+
"#{schema}#{event.gsub(/[ \-_]+/, "_").downcase}"
|
221
227
|
end
|
222
228
|
|
223
229
|
def prepared_statement(keys)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-output-charrington'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.1'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = 'This plugin allows you to output to SQL, via JDBC'
|
6
6
|
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install 'logstash-output-charrington'. This gem is not a stand-alone program"
|