logstash-input-jdbc 4.1.2 → 4.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/logstash/plugin_mixins/jdbc.rb +2 -0
- data/logstash-input-jdbc.gemspec +1 -1
- data/spec/inputs/jdbc_spec.rb +33 -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: 53ec2495d5e7fd90405e7c0b80e1fbf325f819d0
|
4
|
+
data.tar.gz: 1792c0903a6cf5943b1f4930ed5d2a6b60a6a9d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5113d77634809fcac2ee4e1f64c8a5424cfb2626081237b5dff36f85edb8c135c719e9deba8a1945f78cc9ac2fabce2bce33ca39f4bc0a70ee14cfad5fd78da3
|
7
|
+
data.tar.gz: c21241ebf26bb0ae9ac69e9c1e9d1c77e486a9a925a3227f10bbf2b7ea3a6b64f2498fb78b0c17179ba867b87b35e8c40bf4dd954903df61da8520870eaeca3e
|
data/CHANGELOG.md
CHANGED
@@ -275,6 +275,8 @@ module LogStash::PluginMixins::Jdbc
|
|
275
275
|
if value.is_a?(Time)
|
276
276
|
# transform it to LogStash::Timestamp as required by LS
|
277
277
|
LogStash::Timestamp.new(value)
|
278
|
+
elsif value.is_a?(Date)
|
279
|
+
LogStash::Timestamp.new(value.to_time)
|
278
280
|
elsif value.is_a?(DateTime)
|
279
281
|
# Manual timezone conversion detected.
|
280
282
|
# This is slower, so we put it in as a conditional case.
|
data/logstash-input-jdbc.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-input-jdbc'
|
3
|
-
s.version = '4.1.
|
3
|
+
s.version = '4.1.3'
|
4
4
|
s.licenses = ['Apache License (2.0)']
|
5
5
|
s.summary = "This example input streams a string at a definable interval."
|
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 gemname. This gem is not a stand-alone program"
|
data/spec/inputs/jdbc_spec.rb
CHANGED
@@ -33,10 +33,12 @@ describe LogStash::Inputs::Jdbc do
|
|
33
33
|
String :string
|
34
34
|
DateTime :custom_time
|
35
35
|
end
|
36
|
+
db << "CREATE TABLE types_table (num INTEGER, string VARCHAR(255), started_at DATE, custom_time TIMESTAMP, ranking DECIMAL(16,6))"
|
36
37
|
end
|
37
38
|
|
38
39
|
after :each do
|
39
40
|
db.drop_table(:test_table)
|
41
|
+
db.drop_table(:types_table)
|
40
42
|
end
|
41
43
|
|
42
44
|
context "when registering and tearing down" do
|
@@ -1042,4 +1044,35 @@ describe LogStash::Inputs::Jdbc do
|
|
1042
1044
|
end
|
1043
1045
|
end
|
1044
1046
|
end
|
1047
|
+
|
1048
|
+
context "when fetching Various Typed data" do
|
1049
|
+
|
1050
|
+
let(:settings) do
|
1051
|
+
{
|
1052
|
+
"statement" => "SELECT * from types_table"
|
1053
|
+
}
|
1054
|
+
end
|
1055
|
+
|
1056
|
+
before do
|
1057
|
+
db << "INSERT INTO types_table (num, string, started_at, custom_time, ranking) VALUES (1, 'A test', '1999-12-31', '1999-12-31 23:59:59', 95.67)"
|
1058
|
+
|
1059
|
+
plugin.register
|
1060
|
+
end
|
1061
|
+
|
1062
|
+
after do
|
1063
|
+
plugin.stop
|
1064
|
+
end
|
1065
|
+
|
1066
|
+
it "should convert all columns to valid Event acceptable data types" do
|
1067
|
+
plugin.run(queue)
|
1068
|
+
event = queue.pop
|
1069
|
+
expect(event.get("num")).to eq(1)
|
1070
|
+
expect(event.get("string")).to eq("A test")
|
1071
|
+
expect(event.get("started_at")).to be_a(LogStash::Timestamp)
|
1072
|
+
expect(event.get("started_at").to_s).to eq("1999-12-31T00:00:00.000Z")
|
1073
|
+
expect(event.get("custom_time")).to be_a(LogStash::Timestamp)
|
1074
|
+
expect(event.get("custom_time").to_s).to eq("1999-12-31T23:59:59.000Z")
|
1075
|
+
expect(event.get("ranking").to_f).to eq(95.67)
|
1076
|
+
end
|
1077
|
+
end
|
1045
1078
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-jdbc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.1.
|
4
|
+
version: 4.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|