From a3e2c67fd0a79e849988a16b43ccfd62d6031de6 Mon Sep 17 00:00:00 2001 From: Jordan Sissel Date: Mon, 15 Oct 2012 10:19:54 -0700 Subject: [PATCH] Only include 'line' if it is givven in the config file. Use .to_i instead of Integer() --- lib/logstash/outputs/gelf.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/logstash/outputs/gelf.rb b/lib/logstash/outputs/gelf.rb index 7e9e392b4..0930bbd13 100644 --- a/lib/logstash/outputs/gelf.rb +++ b/lib/logstash/outputs/gelf.rb @@ -122,8 +122,8 @@ class LogStash::Outputs::Gelf < LogStash::Outputs::Base m["host"] = event.sprintf(@sender) m["file"] = event.sprintf(@file) - m["line"] = event.sprintf(@line) - m["line"] = Integer(m["line"]) if m["line"].is_a?(String) and m["line"] === /^[\d]+$/ + m["line"] = event.sprintf(@line) if @line + m["line"] = m["line"].to_i if m["line"].is_a?(String) and m["line"] === /^[\d]+$/ if @ship_metadata event.fields.each do |name, value|