Skip to content

Commit

Permalink
- don't prefix file path with / unless necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed Jan 27, 2013
1 parent 23f1855 commit ecb09f5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/logstash/inputs/lumberjack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ def register
public
def run(output_queue)
@lumberjack.run do |l|
source = "lumberjack://#{l.delete("host")}/#{l.delete("file")}"
file = l.delete("file")
if file[0,1] == "/"
source = "lumberjack://#{l.delete("host")}#{file}"
else
source = "lumberjack://#{l.delete("host")}/#{file}"
end
event = to_event(l.delete("line"), source)
# take any remaining fields in the lumberjack event and merge it as a
# field in the logstash event.
Expand Down

0 comments on commit ecb09f5

Please sign in to comment.