From a2116befeaea8faa668716eca3ad7dea14231863 Mon Sep 17 00:00:00 2001 From: Nicholas Radonicich Date: Thu, 21 Sep 2017 17:22:07 -0400 Subject: [PATCH 1/2] Correcting metadata field name --- lib/logstash/inputs/tcp.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/logstash/inputs/tcp.rb b/lib/logstash/inputs/tcp.rb index 7c5ee53..866cc70 100644 --- a/lib/logstash/inputs/tcp.rb +++ b/lib/logstash/inputs/tcp.rb @@ -106,7 +106,7 @@ class LogStash::Inputs::Tcp < LogStash::Inputs::Base config :ssl_extra_chain_certs, :validate => :array, :default => [] HOST_FIELD = "host".freeze - HOST_IP_FIELD = "[@metdata][ip_address]".freeze + HOST_IP_FIELD = "[@metadata][ip_address]".freeze PORT_FIELD = "port".freeze PROXY_HOST_FIELD = "proxy_host".freeze PROXY_PORT_FIELD = "proxy_port".freeze From c7a19cfe73cceaf6f5a3bd080c768be6e0cbed9d Mon Sep 17 00:00:00 2001 From: Nicholas Radonicich Date: Thu, 21 Sep 2017 17:42:21 -0400 Subject: [PATCH 2/2] Correcting tcp_spec.rb to match tcp.rb with metadata.ip_address correction --- spec/inputs/tcp_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/inputs/tcp_spec.rb b/spec/inputs/tcp_spec.rb index 3ae480f..2d51b75 100644 --- a/spec/inputs/tcp_spec.rb +++ b/spec/inputs/tcp_spec.rb @@ -76,7 +76,7 @@ def get_port event = events[i] insist { event.get("message") } == "#{i} ☹" insist { event.get("host") } == host - insist { event.get("[@metdata][ip_address]") } == '127.0.0.1' + insist { event.get("[@metadata][ip_address]") } == '127.0.0.1' end end @@ -367,7 +367,7 @@ def get_port it "should log the error on accept" do allow(input.logger).to receive(:error).with(any_args) - + stop = Thread.new { sleep 2 input.do_stop