logstash-output-file 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/logstash/outputs/file.rb +2 -11
- data/logstash-output-file.gemspec +3 -3
- data/spec/outputs/file_spec.rb +9 -9
- metadata +17 -25
- 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: da39ae041359cb9c00e894ec236fad046a64ee1f
|
4
|
+
data.tar.gz: 00cf8c40f40ec065e87fec578872fc1382d2363a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d4a90d21b59da737b8add19f2829164ddda3b70e870de0bb3aa7fe2bde1d7cfbaa327783df7e460e5aee6be783056e987bf3b0ecee1df7c7737e0a5309248fb
|
7
|
+
data.tar.gz: b298ed0d5d96a7202e84eaf4bc561fbeac446ec90ab3c397c3e153c949865edca0b56655f07eb42ea689db3c1aad6221390904e6099f0bf8cebe01496e118fc7
|
data/README.md
CHANGED
@@ -1,15 +1,15 @@
|
|
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
|
|
@@ -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.
|
@@ -23,14 +23,6 @@ class LogStash::Outputs::File < LogStash::Outputs::Base
|
|
23
23
|
# E.g: `/%{myfield}/`, `/test-%{myfield}/` are not valid paths
|
24
24
|
config :path, :validate => :string, :required => true
|
25
25
|
|
26
|
-
# The maximum size of file to write. When the file exceeds this
|
27
|
-
# threshold, it will be rotated to the current filename + ".1"
|
28
|
-
# If that file already exists, the previous .1 will shift to .2
|
29
|
-
# and so forth.
|
30
|
-
#
|
31
|
-
# NOT YET SUPPORTED
|
32
|
-
config :max_size, :validate => :string
|
33
|
-
|
34
26
|
# The format to use when writing events to the file. This value
|
35
27
|
# supports any string and can include `%{name}` and other dynamic
|
36
28
|
# strings.
|
@@ -109,8 +101,8 @@ class LogStash::Outputs::File < LogStash::Outputs::Base
|
|
109
101
|
end # def receive
|
110
102
|
|
111
103
|
public
|
112
|
-
def
|
113
|
-
@logger.debug("
|
104
|
+
def close
|
105
|
+
@logger.debug("Close: closing files")
|
114
106
|
@files.each do |path, fd|
|
115
107
|
begin
|
116
108
|
fd.close
|
@@ -119,7 +111,6 @@ class LogStash::Outputs::File < LogStash::Outputs::Base
|
|
119
111
|
@logger.error("Exception while flushing and closing files.", :exception => e)
|
120
112
|
end
|
121
113
|
end
|
122
|
-
finished
|
123
114
|
end
|
124
115
|
|
125
116
|
private
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-output-file'
|
4
|
-
s.version = '
|
4
|
+
s.version = '2.0.0'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "This output will write events to files on disk"
|
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,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" }
|
21
21
|
|
22
22
|
# Gem dependencies
|
23
|
-
s.add_runtime_dependency "logstash-core",
|
23
|
+
s.add_runtime_dependency "logstash-core", "~> 2.0.0.snapshot"
|
24
24
|
s.add_runtime_dependency 'logstash-input-generator'
|
25
25
|
|
26
26
|
s.add_development_dependency 'logstash-devutils'
|
data/spec/outputs/file_spec.rb
CHANGED
@@ -82,7 +82,7 @@ describe LogStash::Outputs::File do
|
|
82
82
|
|
83
83
|
it 'doesnt allow the path to start with a dynamic string' do
|
84
84
|
expect { output.register }.to raise_error(LogStash::ConfigurationError)
|
85
|
-
output.
|
85
|
+
output.close
|
86
86
|
end
|
87
87
|
|
88
88
|
context 'doesnt allow the root directory to have some dynamic part' do
|
@@ -93,7 +93,7 @@ describe LogStash::Outputs::File do
|
|
93
93
|
it "with path: #{test_path}" do
|
94
94
|
path = test_path
|
95
95
|
expect { output.register }.to raise_error(LogStash::ConfigurationError)
|
96
|
-
output.
|
96
|
+
output.close
|
97
97
|
end
|
98
98
|
end
|
99
99
|
end
|
@@ -133,7 +133,7 @@ describe LogStash::Outputs::File do
|
|
133
133
|
error_file = File.join(path, config["filename_failure"])
|
134
134
|
|
135
135
|
expect(File.exist?(error_file)).to eq(true)
|
136
|
-
output.
|
136
|
+
output.close
|
137
137
|
end
|
138
138
|
end
|
139
139
|
|
@@ -152,7 +152,7 @@ describe LogStash::Outputs::File do
|
|
152
152
|
output.receive(bad_event)
|
153
153
|
|
154
154
|
expect(Dir.glob(File.join(path, "*")).size).to eq(2)
|
155
|
-
output.
|
155
|
+
output.close
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
@@ -165,7 +165,7 @@ describe LogStash::Outputs::File do
|
|
165
165
|
output.receive(bad_event)
|
166
166
|
|
167
167
|
expect(Dir.glob(File.join(path, "*")).size).to eq(1)
|
168
|
-
output.
|
168
|
+
output.close
|
169
169
|
end
|
170
170
|
end
|
171
171
|
end
|
@@ -183,7 +183,7 @@ describe LogStash::Outputs::File do
|
|
183
183
|
|
184
184
|
good_file = File.join(path, good_event['error'])
|
185
185
|
expect(File.exist?(good_file)).to eq(true)
|
186
|
-
output.
|
186
|
+
output.close
|
187
187
|
end
|
188
188
|
end
|
189
189
|
|
@@ -201,7 +201,7 @@ describe LogStash::Outputs::File do
|
|
201
201
|
output.receive(good_event)
|
202
202
|
|
203
203
|
expect(File.exist?(expected_path)).to eq(true)
|
204
|
-
output.
|
204
|
+
output.close
|
205
205
|
end
|
206
206
|
end
|
207
207
|
|
@@ -223,7 +223,7 @@ describe LogStash::Outputs::File do
|
|
223
223
|
output.receive(good_event)
|
224
224
|
|
225
225
|
expect(File.exist?(expected_path)).to eq(true)
|
226
|
-
output.
|
226
|
+
output.close
|
227
227
|
end
|
228
228
|
end
|
229
229
|
|
@@ -239,7 +239,7 @@ describe LogStash::Outputs::File do
|
|
239
239
|
|
240
240
|
good_file = File.join(path, good_event['error'])
|
241
241
|
expect(File.exist?(good_file)).to eq(true)
|
242
|
-
output.
|
242
|
+
output.close
|
243
243
|
end
|
244
244
|
end
|
245
245
|
end
|
metadata
CHANGED
@@ -1,77 +1,69 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-file
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
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-09-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: logstash-core
|
15
|
-
version_requirements: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - '>='
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 1.4.0
|
20
|
-
- - <
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 2.0.0
|
23
14
|
requirement: !ruby/object:Gem::Requirement
|
24
15
|
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: 1.4.0
|
28
|
-
- - <
|
16
|
+
- - ~>
|
29
17
|
- !ruby/object:Gem::Version
|
30
|
-
version: 2.0.0
|
18
|
+
version: 2.0.0.snapshot
|
19
|
+
name: logstash-core
|
31
20
|
prerelease: false
|
32
21
|
type: :runtime
|
33
|
-
- !ruby/object:Gem::Dependency
|
34
|
-
name: logstash-input-generator
|
35
22
|
version_requirements: !ruby/object:Gem::Requirement
|
36
23
|
requirements:
|
37
|
-
- -
|
24
|
+
- - ~>
|
38
25
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
26
|
+
version: 2.0.0.snapshot
|
27
|
+
- !ruby/object:Gem::Dependency
|
40
28
|
requirement: !ruby/object:Gem::Requirement
|
41
29
|
requirements:
|
42
30
|
- - '>='
|
43
31
|
- !ruby/object:Gem::Version
|
44
32
|
version: '0'
|
33
|
+
name: logstash-input-generator
|
45
34
|
prerelease: false
|
46
35
|
type: :runtime
|
47
|
-
- !ruby/object:Gem::Dependency
|
48
|
-
name: logstash-devutils
|
49
36
|
version_requirements: !ruby/object:Gem::Requirement
|
50
37
|
requirements:
|
51
38
|
- - '>='
|
52
39
|
- !ruby/object:Gem::Version
|
53
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
54
42
|
requirement: !ruby/object:Gem::Requirement
|
55
43
|
requirements:
|
56
44
|
- - '>='
|
57
45
|
- !ruby/object:Gem::Version
|
58
46
|
version: '0'
|
47
|
+
name: logstash-devutils
|
59
48
|
prerelease: false
|
60
49
|
type: :development
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
61
55
|
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
|
62
56
|
email: info@elastic.co
|
63
57
|
executables: []
|
64
58
|
extensions: []
|
65
59
|
extra_rdoc_files: []
|
66
60
|
files:
|
67
|
-
- .gitignore
|
68
61
|
- CHANGELOG.md
|
69
62
|
- CONTRIBUTORS
|
70
63
|
- Gemfile
|
71
64
|
- LICENSE
|
72
65
|
- NOTICE.TXT
|
73
66
|
- README.md
|
74
|
-
- Rakefile
|
75
67
|
- lib/logstash/outputs/file.rb
|
76
68
|
- logstash-output-file.gemspec
|
77
69
|
- spec/outputs/file_spec.rb
|
@@ -97,7 +89,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
89
|
version: '0'
|
98
90
|
requirements: []
|
99
91
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
92
|
+
rubygems_version: 2.4.8
|
101
93
|
signing_key:
|
102
94
|
specification_version: 4
|
103
95
|
summary: This output will write events to files on disk
|
data/.gitignore
DELETED