rack-logstash-writer 1.0.9 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3aada1afff771015b494f076de19c83084bb21e
4
- data.tar.gz: 452c8a19da077cbc514e6215248aa76f6bf019b4
3
+ metadata.gz: e98bb12f3f55ddb25a76ba04a5edb188647e8a23
4
+ data.tar.gz: e5d61d341bd497a227a1fc4e889c972a5933ebfb
5
5
  SHA512:
6
- metadata.gz: 780f10c76e20bd779caf400aedf518b472e41557f617cbb8d3369630f3533ead53e382f329abbf666a60554146b722db5743c5603f7f78f48a2fe47c6a9626fd
7
- data.tar.gz: 5ac34507e109f17f643803f81d87974524e5adea95dda42d58d5298991fa689cdb2ff20ae969ea3b60ab61513a19d5b046902bf699064f99e8ed1e563e192f96
6
+ metadata.gz: 9b2a9042e0590cf9e5b4c19ceae444c57e1036909af7f46f207a799ec1d0d6c4f2ea557d3f85387a9d0caad5a0788f55a834a5c0e8d92a716e8e040abc0a6136
7
+ data.tar.gz: 4e34874f42debe094a585a3a96f0da06993900ce2e5043f19154108c0671671c787c26afc460def23e8bcbd426ed391b0b3888a99d79c874e5fe5855ee25d5cd
@@ -59,12 +59,13 @@ module Rack
59
59
  :method => env["REQUEST_METHOD"],
60
60
  :path => env["PATH_INFO"],
61
61
  :query_string => env["QUERY_STRING"],
62
- :host => env["REMOTE_HOST"],
62
+ :host => Socket.gethostname,
63
63
  :status => status.to_i,
64
64
  :duration => (Time.now - began_at),
65
65
  :remote_addr => env['REMOTE_ADDR'],
66
66
  :request => request_line(env),
67
67
  :"X-Forwarded-For" => response_headers['X-Forwarded-For']
68
+
68
69
  }
69
70
 
70
71
  # Added calling for the proc and merge the data if it exists
@@ -80,10 +81,7 @@ module Rack
80
81
 
81
82
  data[:error_msg] = env["sinatra.error"] if env.has_key?("sinatra.error")
82
83
 
83
- if data[:host] =='localhost'
84
- soc = Socket.ip_address_list.map {|s| s.ip_address}.reject {|s| s=='127.0.0.1'}.select {|s| 16 >(s.size) && (s.size)>10}.first
85
- data[:host] = "ip-#{soc.gsub(".","-")}"
86
- end
84
+
87
85
 
88
86
  @options[:body_regex].each { |k,v| data[k] = data[:body].to_s.match(/#{v}/).captures[0].gsub("\\","").gsub("\"","") rescue data[k]= "" } if !@options[:body_regex].nil?
89
87
 
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class LogstashWriter
3
- VERSION = "1.0.9"
3
+ VERSION = "1.1.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-logstash-writer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.9
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - or garfunkel