fluent-plugin-vmware-loginsight 0.1.4 → 0.1.5
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 +4 -4
- data/README.md +6 -3
- data/examples/Dockerfile +1 -0
- data/examples/fluent.conf +1 -0
- data/fluent-plugin-vmware-loginsight.gemspec +1 -1
- data/lib/fluent/plugin/out_vmware_loginsight.rb +9 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 769cbf3caa38634e432618e399254da2f53d6ba18e8b2def4b9d172aaed29c63
|
4
|
+
data.tar.gz: ba0ef75193473229d2d1d47de0866160e261dcd19672f5fde1c7bdfd9b423ea1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e6a40c4f69297840d6da7cab368a22df065080e0e3706e351686f67ea440d04d8a550d1b4554bac46a25d922be4c40584afb42ffe958c3f48b1cdb18d19822f
|
7
|
+
data.tar.gz: 1f954795a9d5064904df57469ebe071f94400a39644b14101767542a13bab312a6091ca0348855c8c392be385edf030374e3588c1d012da7208d0c8a6d74b335
|
data/README.md
CHANGED
@@ -101,6 +101,9 @@ request_retries, :integer, :default => 3
|
|
101
101
|
# http connection ttl for each request
|
102
102
|
request_timeout, :time, :default => 5
|
103
103
|
|
104
|
+
# If set, enables debug logs for http connection
|
105
|
+
http_conn_debug, :bool, :default => false :: Valid Value: true | false
|
106
|
+
|
104
107
|
# Simple rate limiting: ignore any records within `rate_limit_msec` since the last one
|
105
108
|
rate_limit_msec, :integer, :default => 0
|
106
109
|
|
@@ -113,15 +116,15 @@ include_tag_key, :bool, :default => true :: Valid Value: true | false
|
|
113
116
|
# Metadata key that identifies Fluentd tags
|
114
117
|
tag_key, :string, :default => 'tag'
|
115
118
|
|
116
|
-
# Keys from log event whose values should be added as log message/text
|
117
|
-
#
|
119
|
+
# Keys from log event whose values should be added as log message/text to loginsight.
|
120
|
+
# These key/value pairs won't expanded/flattened and won't be added as metadata/fields.
|
118
121
|
log_text_keys, :array, :default => ["log", "message", "msg"] :: Valid Value: Array of strings
|
119
122
|
|
120
123
|
# Flatten hashes to create one key/val pair w/o losing log data
|
121
124
|
flatten_hashes, :bool, :default => true :: Valid Value: true | false
|
122
125
|
|
123
126
|
# Seperator to use for joining flattened keys
|
124
|
-
flatten_hashes_separator, :string, :default => "
|
127
|
+
flatten_hashes_separator, :string, :default => "_"
|
125
128
|
```
|
126
129
|
|
127
130
|
For more examples look at [examples](./examples/)
|
data/examples/Dockerfile
CHANGED
@@ -21,6 +21,7 @@ RUN buildDeps="sudo make gcc g++ libc-dev ruby-dev libffi-dev" \
|
|
21
21
|
&& sudo gem install \
|
22
22
|
fluent-plugin-systemd \
|
23
23
|
fluent-plugin-kubernetes_metadata_filter \
|
24
|
+
fluent-plugin-vmware-loginsight \
|
24
25
|
&& sudo gem sources --clear-all \
|
25
26
|
&& SUDO_FORCE_REMOVE=yes \
|
26
27
|
apt-get purge -y --auto-remove \
|
data/examples/fluent.conf
CHANGED
@@ -14,7 +14,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
14
14
|
|
15
15
|
Gem::Specification.new do |spec|
|
16
16
|
spec.name = "fluent-plugin-vmware-loginsight"
|
17
|
-
spec.version = "0.1.
|
17
|
+
spec.version = "0.1.5"
|
18
18
|
spec.authors = ["Vishal Mohite", "Chris Todd"]
|
19
19
|
spec.email = ["vmohite@vmware.com", "toddc@vmware.com"]
|
20
20
|
|
@@ -51,6 +51,7 @@ module Fluent
|
|
51
51
|
config_param :serializer, :string, :default => :json
|
52
52
|
config_param :request_retries, :integer, :default => 3
|
53
53
|
config_param :request_timeout, :time, :default => 5
|
54
|
+
config_param :http_conn_debug, :bool, :default => false
|
54
55
|
config_param :max_batch_size, :integer, :default => 512000
|
55
56
|
|
56
57
|
# Simple rate limiting: ignore any records within `rate_limit_msec`
|
@@ -68,7 +69,7 @@ module Fluent
|
|
68
69
|
# Flatten hashes to create one key/val pair w/o losing log data
|
69
70
|
config_param :flatten_hashes, :bool, :default => true
|
70
71
|
# Seperator to use for joining flattened keys
|
71
|
-
config_param :flatten_hashes_separator, :string, :default => "
|
72
|
+
config_param :flatten_hashes_separator, :string, :default => "_"
|
72
73
|
|
73
74
|
|
74
75
|
def initialize
|
@@ -116,10 +117,8 @@ module Fluent
|
|
116
117
|
|
117
118
|
def shorten_key(key)
|
118
119
|
# LI doesn't allow some characters in field 'name'
|
119
|
-
# like '/', '-', '\', '.', etc. so replace them with
|
120
|
-
key = key.gsub(/[\/\.\-\\]
|
121
|
-
# remove double underscores
|
122
|
-
key = key.gsub(/__/,'_')
|
120
|
+
# like '/', '-', '\', '.', etc. so replace them with @flatten_hashes_separator
|
121
|
+
key = key.gsub(/[\/\.\-\\]/,@flatten_hashes_separator).downcase
|
123
122
|
# shorten field names
|
124
123
|
key = key.gsub(/kubernetes_/,'k8s_')
|
125
124
|
key = key.gsub(/namespace/,'ns')
|
@@ -154,7 +153,7 @@ module Fluent
|
|
154
153
|
# convert value to json string if its a hash and to string if not already a string
|
155
154
|
begin
|
156
155
|
value = value.to_json if value.is_a?(Hash)
|
157
|
-
value = value.to_s
|
156
|
+
value = value.to_s
|
158
157
|
value.force_encoding("utf-8")
|
159
158
|
rescue Exception=>e
|
160
159
|
$log.warn "force_encoding exception: " "#{e.class}, '#{e.message}', " \
|
@@ -203,8 +202,9 @@ module Fluent
|
|
203
202
|
end
|
204
203
|
end
|
205
204
|
when Array
|
206
|
-
|
207
|
-
|
205
|
+
record.each do |value|
|
206
|
+
ret.merge! flatten_record(value, prefix)
|
207
|
+
end
|
208
208
|
else
|
209
209
|
return {prefix.join(@flatten_hashes_separator) => record}
|
210
210
|
end
|
@@ -238,7 +238,7 @@ module Fluent
|
|
238
238
|
|
239
239
|
http_conn = Net::HTTP.new(uri.host, uri.port)
|
240
240
|
# For debugging, set this
|
241
|
-
|
241
|
+
http_conn.set_debug_output($stdout) if @http_conn_debug
|
242
242
|
http_conn.use_ssl = (uri.scheme == 'https')
|
243
243
|
if http_conn.use_ssl?
|
244
244
|
http_conn.ca_file = @ca_file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-vmware-loginsight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vishal Mohite
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-10-
|
12
|
+
date: 2018-10-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|