logstash-input-sqlite 0.1.4 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/NOTICE.TXT +5 -0
- data/README.md +5 -5
- data/lib/logstash/inputs/sqlite.rb +5 -2
- data/logstash-input-sqlite.gemspec +4 -3
- data/spec/inputs/sqlite_spec.rb +10 -0
- metadata +23 -9
- data/.gitignore +0 -4
- data/Rakefile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7e28a8e01b77aba99c8f9847918becd22646079
|
4
|
+
data.tar.gz: 1affa26c0eee37f7d4a423561be7664a9bf77040
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cef09ba0ecb3cbd40cd4ac606dc4e3f9a4a53f0f9829639f9136833da30d66393258cf3548d5355166c7aaf3c226fa5634320dad7453d62ed67a0cdc9c176a20
|
7
|
+
data.tar.gz: a6a2e42f7b8af934d2f812c81f839085af321a2eef648d7b46ebdc0995a2407fa7208e9cd7c42552bc8933af6575db00c743d7ce39a5777ed70aa7b60787b4d3
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,5 @@
|
|
1
|
+
## 2.0.0
|
2
|
+
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
|
3
|
+
instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
|
4
|
+
- Dependency on logstash-core update to 2.0
|
5
|
+
|
data/NOTICE.TXT
ADDED
data/README.md
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
# Logstash Plugin
|
2
2
|
|
3
|
-
This is a plugin for [Logstash](https://github.com/
|
3
|
+
This is a plugin for [Logstash](https://github.com/elastic/logstash).
|
4
4
|
|
5
5
|
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
|
6
6
|
|
7
7
|
## Documentation
|
8
8
|
|
9
|
-
Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.
|
9
|
+
Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
|
10
10
|
|
11
11
|
- For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
|
12
|
-
- For more asciidoc formatting tips, see the excellent reference here https://github.com/
|
12
|
+
- For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
|
13
13
|
|
14
14
|
## Need Help?
|
15
15
|
|
16
|
-
Need help? Try #logstash on freenode IRC or the logstash
|
16
|
+
Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
|
17
17
|
|
18
18
|
## Developing
|
19
19
|
|
@@ -83,4 +83,4 @@ Programming is not a required skill. Whatever you've seen about open source and
|
|
83
83
|
|
84
84
|
It is more important to the community that you are able to contribute.
|
85
85
|
|
86
|
-
For more information about contributing, see the [CONTRIBUTING](https://github.com/
|
86
|
+
For more information about contributing, see the [CONTRIBUTING](https://github.com/elastic/logstash/blob/master/CONTRIBUTING.md) file.
|
@@ -2,6 +2,8 @@
|
|
2
2
|
require "logstash/inputs/base"
|
3
3
|
require "logstash/namespace"
|
4
4
|
require "socket"
|
5
|
+
require "stud/interval"
|
6
|
+
require "concurrent"
|
5
7
|
|
6
8
|
|
7
9
|
# Read rows from an sqlite database.
|
@@ -146,7 +148,7 @@ class LogStash::Inputs::Sqlite < LogStash::Inputs::Base
|
|
146
148
|
|
147
149
|
begin
|
148
150
|
@logger.debug("Tailing sqlite db", :path => @path)
|
149
|
-
|
151
|
+
until stop?
|
150
152
|
count = 0
|
151
153
|
@table_data.each do |k, table|
|
152
154
|
table_name = table[:name]
|
@@ -174,7 +176,8 @@ class LogStash::Inputs::Sqlite < LogStash::Inputs::Base
|
|
174
176
|
# sleep a bit
|
175
177
|
@logger.debug("No new rows. Sleeping.", :time => sleeptime)
|
176
178
|
sleeptime = [sleeptime * 2, sleep_max].min
|
177
|
-
|
179
|
+
|
180
|
+
Stud.stoppable_sleep(sleeptime) { stop? }
|
178
181
|
else
|
179
182
|
sleeptime = sleep_min
|
180
183
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-sqlite'
|
4
|
-
s.version = '0.1
|
4
|
+
s.version = '2.0.1'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Read rows from an sqlite database."
|
7
7
|
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.require_paths = ["lib"]
|
12
12
|
|
13
13
|
# Files
|
14
|
-
s.files =
|
14
|
+
s.files = Dir['lib/**/*','spec/**/*','vendor/**/*','*.gemspec','*.md','CONTRIBUTORS','Gemfile','LICENSE','NOTICE.TXT']
|
15
15
|
|
16
16
|
# Tests
|
17
17
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
@@ -20,11 +20,12 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "input" }
|
21
21
|
|
22
22
|
# Gem dependencies
|
23
|
-
s.add_runtime_dependency "logstash-core",
|
23
|
+
s.add_runtime_dependency "logstash-core", ">= 2.0.0.snapshot", "< 3.0.0"
|
24
24
|
|
25
25
|
s.add_runtime_dependency 'sequel'
|
26
26
|
s.add_runtime_dependency 'jdbc-sqlite3'
|
27
27
|
|
28
28
|
s.add_development_dependency 'logstash-devutils'
|
29
|
+
s.add_development_dependency 'logstash-codec-plain'
|
29
30
|
end
|
30
31
|
|
data/spec/inputs/sqlite_spec.rb
CHANGED
@@ -1 +1,11 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require "logstash/devutils/rspec/spec_helper"
|
3
|
+
require "logstash/inputs/sqlite"
|
4
|
+
require "logstash/codecs/plain"
|
5
|
+
|
6
|
+
describe LogStash::Inputs::Sqlite do
|
7
|
+
describe "stopping" do
|
8
|
+
let(:config) { {"path" => "testdb.sqlite3"} }
|
9
|
+
it_behaves_like "an interruptible input plugin"
|
10
|
+
end
|
11
|
+
end
|
metadata
CHANGED
@@ -1,24 +1,24 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-sqlite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - '>='
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version:
|
18
|
+
version: 2.0.0.snapshot
|
19
19
|
- - <
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
21
|
+
version: 3.0.0
|
22
22
|
name: logstash-core
|
23
23
|
prerelease: false
|
24
24
|
type: :runtime
|
@@ -26,10 +26,10 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 2.0.0.snapshot
|
30
30
|
- - <
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: 3.0.0
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
requirement: !ruby/object:Gem::Requirement
|
35
35
|
requirements:
|
@@ -72,18 +72,32 @@ dependencies:
|
|
72
72
|
- - '>='
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
name: logstash-codec-plain
|
82
|
+
prerelease: false
|
83
|
+
type: :development
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
75
89
|
description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
|
76
90
|
email: info@elastic.co
|
77
91
|
executables: []
|
78
92
|
extensions: []
|
79
93
|
extra_rdoc_files: []
|
80
94
|
files:
|
81
|
-
- .
|
95
|
+
- CHANGELOG.md
|
82
96
|
- CONTRIBUTORS
|
83
97
|
- Gemfile
|
84
98
|
- LICENSE
|
99
|
+
- NOTICE.TXT
|
85
100
|
- README.md
|
86
|
-
- Rakefile
|
87
101
|
- lib/logstash/inputs/sqlite.rb
|
88
102
|
- logstash-input-sqlite.gemspec
|
89
103
|
- spec/inputs/sqlite_spec.rb
|
@@ -109,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
123
|
version: '0'
|
110
124
|
requirements: []
|
111
125
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
126
|
+
rubygems_version: 2.4.8
|
113
127
|
signing_key:
|
114
128
|
specification_version: 4
|
115
129
|
summary: Read rows from an sqlite database.
|
data/.gitignore
DELETED