logstash-input-stdin 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/logstash/inputs/stdin.rb +19 -9
- data/logstash-input-stdin.gemspec +3 -1
- metadata +31 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9813102cbd74fef793ca3fdab9fc764d18b5493
|
4
|
+
data.tar.gz: 32eaab033a997c2267bf33a397b1095b97dac2ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8de106cfc9f7e77a520793fc37faae679dbd92c9bb41b2d535472aaf2bf7ab4c37e1c701526e795f9b720e76b885b2aaa6a8dd3c7a22882586df3472b1b36cdf
|
7
|
+
data.tar.gz: 6b50963b536487e75d051e1f6098f7a5e3315fb7ba82c8281ec1bdfe05f96288e402180fa2781bc5fb11f0097b4082c058a488416398898a111d1a60ad850e2e
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require "logstash/inputs/base"
|
3
3
|
require "logstash/namespace"
|
4
|
+
require "concurrent/atomics"
|
4
5
|
require "socket" # for Socket.gethostname
|
5
6
|
|
6
7
|
# Read events from standard input.
|
@@ -12,14 +13,18 @@ class LogStash::Inputs::Stdin < LogStash::Inputs::Base
|
|
12
13
|
|
13
14
|
default :codec, "line"
|
14
15
|
|
15
|
-
|
16
|
+
def initialize(*args)
|
17
|
+
super(*args)
|
18
|
+
@stop_requested = Concurrent::AtomicBoolean.new(false)
|
19
|
+
end
|
20
|
+
|
16
21
|
def register
|
17
22
|
@host = Socket.gethostname
|
18
23
|
fix_streaming_codecs
|
19
|
-
end
|
24
|
+
end
|
20
25
|
|
21
|
-
def run(queue)
|
22
|
-
while
|
26
|
+
def run(queue)
|
27
|
+
while @stop_requested.false?
|
23
28
|
begin
|
24
29
|
# Based on some testing, there is no way to interrupt an IO.sysread nor
|
25
30
|
# IO.select call in JRuby. Bummer :(
|
@@ -31,16 +36,21 @@ class LogStash::Inputs::Stdin < LogStash::Inputs::Base
|
|
31
36
|
end
|
32
37
|
rescue IOError, EOFError, LogStash::ShutdownSignal
|
33
38
|
# stdin closed or a requested shutdown
|
39
|
+
@stop_requested.make_true
|
34
40
|
break
|
41
|
+
rescue => e
|
42
|
+
# ignore any exception in the shutdown process
|
43
|
+
break if @stop_requested.true?
|
44
|
+
raise(e)
|
35
45
|
end
|
36
|
-
end
|
46
|
+
end
|
37
47
|
finished
|
38
|
-
end
|
48
|
+
end
|
39
49
|
|
40
|
-
public
|
41
50
|
def teardown
|
51
|
+
@stop_requested.make_true
|
42
52
|
@logger.debug("stdin shutting down.")
|
43
53
|
$stdin.close rescue nil
|
44
54
|
finished
|
45
|
-
end
|
46
|
-
end
|
55
|
+
end
|
56
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-stdin'
|
4
|
-
s.version = '0.1.
|
4
|
+
s.version = '0.1.6'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Read events from standard input"
|
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"
|
@@ -26,6 +26,8 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.add_runtime_dependency 'logstash-codec-line'
|
27
27
|
s.add_runtime_dependency 'logstash-codec-json'
|
28
28
|
s.add_runtime_dependency 'logstash-codec-json_lines'
|
29
|
+
s.add_runtime_dependency 'concurrent-ruby'
|
30
|
+
|
29
31
|
s.add_development_dependency 'logstash-devutils'
|
30
32
|
end
|
31
33
|
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-input-stdin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
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-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
|
14
|
+
name: logstash-core
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
15
16
|
requirements:
|
16
17
|
- - '>='
|
17
18
|
- !ruby/object:Gem::Version
|
@@ -19,10 +20,7 @@ dependencies:
|
|
19
20
|
- - <
|
20
21
|
- !ruby/object:Gem::Version
|
21
22
|
version: 2.0.0
|
22
|
-
|
23
|
-
prerelease: false
|
24
|
-
type: :runtime
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirement: !ruby/object:Gem::Requirement
|
26
24
|
requirements:
|
27
25
|
- - '>='
|
28
26
|
- !ruby/object:Gem::Version
|
@@ -30,76 +28,92 @@ dependencies:
|
|
30
28
|
- - <
|
31
29
|
- !ruby/object:Gem::Version
|
32
30
|
version: 2.0.0
|
31
|
+
prerelease: false
|
32
|
+
type: :runtime
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
+
name: logstash-codec-plain
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
34
40
|
requirement: !ruby/object:Gem::Requirement
|
35
41
|
requirements:
|
36
42
|
- - '>='
|
37
43
|
- !ruby/object:Gem::Version
|
38
44
|
version: '0'
|
39
|
-
name: logstash-codec-plain
|
40
45
|
prerelease: false
|
41
46
|
type: :runtime
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: logstash-codec-line
|
42
49
|
version_requirements: !ruby/object:Gem::Requirement
|
43
50
|
requirements:
|
44
51
|
- - '>='
|
45
52
|
- !ruby/object:Gem::Version
|
46
53
|
version: '0'
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
54
|
requirement: !ruby/object:Gem::Requirement
|
49
55
|
requirements:
|
50
56
|
- - '>='
|
51
57
|
- !ruby/object:Gem::Version
|
52
58
|
version: '0'
|
53
|
-
name: logstash-codec-line
|
54
59
|
prerelease: false
|
55
60
|
type: :runtime
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: logstash-codec-json
|
56
63
|
version_requirements: !ruby/object:Gem::Requirement
|
57
64
|
requirements:
|
58
65
|
- - '>='
|
59
66
|
- !ruby/object:Gem::Version
|
60
67
|
version: '0'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
68
|
requirement: !ruby/object:Gem::Requirement
|
63
69
|
requirements:
|
64
70
|
- - '>='
|
65
71
|
- !ruby/object:Gem::Version
|
66
72
|
version: '0'
|
67
|
-
name: logstash-codec-json
|
68
73
|
prerelease: false
|
69
74
|
type: :runtime
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: logstash-codec-json_lines
|
70
77
|
version_requirements: !ruby/object:Gem::Requirement
|
71
78
|
requirements:
|
72
79
|
- - '>='
|
73
80
|
- !ruby/object:Gem::Version
|
74
81
|
version: '0'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
82
|
requirement: !ruby/object:Gem::Requirement
|
77
83
|
requirements:
|
78
84
|
- - '>='
|
79
85
|
- !ruby/object:Gem::Version
|
80
86
|
version: '0'
|
81
|
-
name: logstash-codec-json_lines
|
82
87
|
prerelease: false
|
83
88
|
type: :runtime
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: concurrent-ruby
|
84
91
|
version_requirements: !ruby/object:Gem::Requirement
|
85
92
|
requirements:
|
86
93
|
- - '>='
|
87
94
|
- !ruby/object:Gem::Version
|
88
95
|
version: '0'
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
96
|
requirement: !ruby/object:Gem::Requirement
|
91
97
|
requirements:
|
92
98
|
- - '>='
|
93
99
|
- !ruby/object:Gem::Version
|
94
100
|
version: '0'
|
95
|
-
name: logstash-devutils
|
96
101
|
prerelease: false
|
97
|
-
type: :
|
102
|
+
type: :runtime
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: logstash-devutils
|
98
105
|
version_requirements: !ruby/object:Gem::Requirement
|
99
106
|
requirements:
|
100
107
|
- - '>='
|
101
108
|
- !ruby/object:Gem::Version
|
102
109
|
version: '0'
|
110
|
+
requirement: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - '>='
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
prerelease: false
|
116
|
+
type: :development
|
103
117
|
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
|
104
118
|
email: info@elastic.co
|
105
119
|
executables: []
|