mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Only include 'line' if it is givven in the config file. Use .to_i instead of Integer()
This commit is contained in:
parent
8a25053d79
commit
a3e2c67fd0
1 changed files with 2 additions and 2 deletions
|
@ -122,8 +122,8 @@ class LogStash::Outputs::Gelf < LogStash::Outputs::Base
|
||||||
|
|
||||||
m["host"] = event.sprintf(@sender)
|
m["host"] = event.sprintf(@sender)
|
||||||
m["file"] = event.sprintf(@file)
|
m["file"] = event.sprintf(@file)
|
||||||
m["line"] = event.sprintf(@line)
|
m["line"] = event.sprintf(@line) if @line
|
||||||
m["line"] = Integer(m["line"]) if m["line"].is_a?(String) and m["line"] === /^[\d]+$/
|
m["line"] = m["line"].to_i if m["line"].is_a?(String) and m["line"] === /^[\d]+$/
|
||||||
|
|
||||||
if @ship_metadata
|
if @ship_metadata
|
||||||
event.fields.each do |name, value|
|
event.fields.each do |name, value|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue