Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fluent-plugin-bin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
fluent-plugin-bin
Commits
e320f937
Commit
e320f937
authored
Sep 23, 2016
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt to fluentd 0.14
parent
f69d1063
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
fluent-plugin-bin.gemspec
fluent-plugin-bin.gemspec
+1
-1
lib/fluent/plugin/in_bin.rb
lib/fluent/plugin/in_bin.rb
+12
-9
No files found.
fluent-plugin-bin.gemspec
View file @
e320f937
...
...
@@ -11,5 +11,5 @@ Gem::Specification.new do |gem|
gem
.
files
=
`git ls-files -z`
.
split
(
"
\x0
"
)
gem
.
require_paths
=
[
"lib"
]
gem
.
add_runtime_dependency
"
fluentd
"
,
"~> 0.1
2
"
gem
.
add_runtime_dependency
"
fluentd
"
,
"~> 0.1
4
"
end
lib/fluent/plugin/in_bin.rb
View file @
e320f937
...
...
@@ -15,12 +15,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
require
'fluent/
input
'
require
'fluent/
plugin/in_tail
'
module
Fluent
module
Fluent
::Plugin
class
BinInput
<
New
TailInput
Plugin
.
register_input
(
'bin'
,
self
)
class
BinInput
<
TailInput
Fluent
::
Plugin
.
register_input
(
'bin'
,
self
)
def
convert_line_to_event
(
line
,
es
,
tail_watcher
)
begin
...
...
@@ -34,11 +34,14 @@ module Fluent
def
setup_watcher
(
path
,
pe
)
line_buffer_timer_flusher
=
(
@multiline_mode
&&
@multiline_flush_interval
)
?
TailWatcher
::
LineBufferTimerFlusher
.
new
(
log
,
@multiline_flush_interval
,
&
method
(
:flush_buffer
))
:
nil
tw
=
TailWatcher
.
new
(
path
,
@rotate_wait
,
pe
,
log
,
@read_from_head
,
@enable_watch_timer
,
@read_lines_limit
,
method
(
:update_watcher
),
line_buffer_timer_flusher
,
&
method
(
:receive_lines
))
tw
.
attach
(
@loop
)
tw
.
attach
do
|
watcher
|
timer_execute
(
:in_tail_timer_trigger
,
1
,
&
watcher
.
method
(
:on_notify
))
if
watcher
.
enable_watch_timer
event_loop_attach
(
watcher
.
stat_trigger
)
end
tw
end
class
TailWatcher
<
New
TailInput
::
TailWatcher
class
TailWatcher
<
TailInput
::
TailWatcher
def
on_rotate
(
io
)
if
@io_handler
==
nil
if
io
...
...
@@ -104,7 +107,7 @@ module Fluent
def
swap_state
(
pe
)
# Use MemoryPositionEntry for rotated file temporary
mpe
=
MemoryPositionEntry
.
new
mpe
=
TailInput
::
MemoryPositionEntry
.
new
mpe
.
update
(
pe
.
read_inode
,
pe
.
read_pos
)
@pe
=
mpe
@io_handler
.
pe
=
mpe
# Don't re-create IOHandler because IOHandler has an internal buffer.
...
...
@@ -113,7 +116,7 @@ module Fluent
end
end
class
IOHandler
<
New
TailInput
::
TailWatcher
::
IOHandler
class
IOHandler
<
TailInput
::
TailWatcher
::
IOHandler
def
initialize
(
io
,
pe
,
log
,
read_lines_limit
,
first
=
true
,
&
receive_lines
)
@log
=
log
@log
.
info
"following
#{
io
.
path
}
"
if
first
...
...
@@ -161,4 +164,4 @@ module Fluent
end
end
end
end
\ No newline at end of file
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment