Skip to content

Commit

Permalink
in_tail: Add log messages about corrupted lines in pos_file
Browse files Browse the repository at this point in the history
Signed-off-by: Alexey Schurov <[email protected]>
  • Loading branch information
vitclone committed Aug 31, 2018
1 parent dcac5fb commit cdc7109
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/fluent/plugin/in_tail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,10 @@ def self.parse(file)
file.pos = 0
file.each_line {|line|
m = /^([^\t]+)\t([0-9a-fA-F]+)\t([0-9a-fA-F]+)/.match(line)
next unless m
unless m
$log.warn "Unparsable line in pos_file: #{line}"
next
end
path = m[1]
pos = m[2].to_i(16)
ino = m[3].to_i(16)
Expand All @@ -913,7 +916,10 @@ def self.compact(file)
file.pos = 0
existent_entries = file.each_line.map { |line|
m = /^([^\t]+)\t([0-9a-fA-F]+)\t([0-9a-fA-F]+)/.match(line)
next unless m
unless m
$log.warn "Unparsable line in pos_file: #{line}"
next
end
path = m[1]
pos = m[2].to_i(16)
ino = m[3].to_i(16)
Expand Down

0 comments on commit cdc7109

Please sign in to comment.