fluent-plugin-directory 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/fluent-plugin-directory.gemspec +1 -1
- data/lib/fluent/plugin/in_directory.rb +18 -9
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 55d77adfb2d0512e04037176adff4a2b82e16cf9264efce510eb61d88af5c64c
|
4
|
+
data.tar.gz: cc44c79f31f7194f6c45080cff9a4b6ed8cf6f3ba55f7ef827ea1a88d0d94ef0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff2e8b35d7118616430406a4a6740ce9636d05c64fd2ec48e3a40f4108d2c927b2a6394a4ad1f7f58bfa579ab2dff5b5970cabeac6b7309ef001154d467c5233
|
7
|
+
data.tar.gz: 9e83689cd6e2da654949c702500798ded723e2d4f2db5c0a4635c2b165f483301faf62c0009761d2046862636e972a9b13cf98421acce63b0a0b0adf4a54aeb3
|
@@ -22,6 +22,9 @@ module Fluent
|
|
22
22
|
|
23
23
|
helpers :timer
|
24
24
|
|
25
|
+
desc 'The maximum number of files processed in each run.'
|
26
|
+
config_param :batch_size, :integer, default: 10
|
27
|
+
|
25
28
|
desc 'The field where the content of the file is stored in the output event.'
|
26
29
|
config_param :content_key, :string, default: 'content'
|
27
30
|
|
@@ -50,16 +53,22 @@ module Fluent
|
|
50
53
|
time = Fluent::Engine.now
|
51
54
|
|
52
55
|
# Read filenames in the directory
|
53
|
-
Dir
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
56
|
+
Dir
|
57
|
+
.glob(@path + '/*')
|
58
|
+
.take(@batch_size)
|
59
|
+
.each do |filename|
|
60
|
+
# Add the record to the stream
|
61
|
+
multiEventStream.add(
|
62
|
+
time,
|
63
|
+
{
|
64
|
+
@content_key => File.read(filename),
|
65
|
+
@filename_key => filename
|
66
|
+
}
|
67
|
+
)
|
59
68
|
|
60
|
-
|
61
|
-
|
62
|
-
|
69
|
+
# Remove the file
|
70
|
+
File.delete(filename)
|
71
|
+
end
|
63
72
|
|
64
73
|
# Send the events
|
65
74
|
router.emit_stream(tag, multiEventStream)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-directory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rémy DUTHU
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
106
|
- !ruby/object:Gem::Version
|
107
107
|
version: '0'
|
108
108
|
requirements: []
|
109
|
-
rubygems_version: 3.0.3
|
109
|
+
rubygems_version: 3.0.3.1
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: A Fluentd input plugin to scan files recurrently from a directory
|