fluent-plugin-site24x7 0.1.1 → 0.1.2
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/fluent-plugin-site24x7.gemspec +1 -1
- data/lib/fluent/plugin/out_site24x7.rb +15 -8
- 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: c2391265977dd8a33dde6dab1876296406fae59c7633aa0ec0045821bb5688f1
|
4
|
+
data.tar.gz: 6bd7a51fca919c3c38c4f12cf226f403772c473d12f8c2a716f72ccb844f5ec7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aab17017da06b62df8c7ebc8b2ee5e045e9833687945fd1f262890bd32bc9478f58208e1e07675e4295dd5c05fc6691bad50a19c35ea635c50d627438bb6dd01
|
7
|
+
data.tar.gz: de638056920dcc7cce4a00c1bddad3a4628ce5342e3b837e430d599f5f0db949ffcd81ff18efa55eca2e2d07b8dec761f3bd673367a076af3c69e8dcee6dd7ef
|
@@ -64,8 +64,13 @@ class Fluent::Site24x7Output < Fluent::Plugin::Output
|
|
64
64
|
@s247_http_client.shutdown if @s247_http_client
|
65
65
|
end
|
66
66
|
|
67
|
+
def base64_url_decode(str)
|
68
|
+
str += '=' * (4 - str.length.modulo(4))
|
69
|
+
Base64.decode64(str.tr('-_','+/'))
|
70
|
+
end
|
71
|
+
|
67
72
|
def init_variables()
|
68
|
-
@logtype_config = Yajl::Parser.parse(
|
73
|
+
@logtype_config = Yajl::Parser.parse(base64_url_decode(@log_type_config))
|
69
74
|
@s247_custom_regex = if @logtype_config.has_key? 'regex' then Regexp.compile(@logtype_config['regex'].gsub('?P<','?<')) else nil end
|
70
75
|
@s247_ignored_fields = if @logtype_config.has_key? 'ignored_fields' then @logtype_config['ignored_fields'] else [] end
|
71
76
|
@s247_tz = {'hrs': 0, 'mins': 0} #UTC
|
@@ -76,12 +81,12 @@ class Fluent::Site24x7Output < Fluent::Plugin::Output
|
|
76
81
|
@s247_datetime_format_string = @logtype_config['dateFormat']
|
77
82
|
@s247_datetime_format_string = @s247_datetime_format_string.sub('%f', '%N')
|
78
83
|
if !@s247_datetime_format_string.include? 'unix'
|
79
|
-
is_year_present = if @s247_datetime_format_string.include?('%y') || @s247_datetime_format_string.include?('%Y') then true else false end
|
80
|
-
if
|
84
|
+
@is_year_present = if @s247_datetime_format_string.include?('%y') || @s247_datetime_format_string.include?('%Y') then true else false end
|
85
|
+
if !@is_year_present
|
81
86
|
@s247_datetime_format_string = @s247_datetime_format_string+ ' %Y'
|
82
87
|
end
|
83
|
-
is_timezone_present = if @s247_datetime_format_string.include? '%z' then true else false end
|
84
|
-
if
|
88
|
+
@is_timezone_present = if @s247_datetime_format_string.include? '%z' then true else false end
|
89
|
+
if !@is_timezone_present && @logtype_config.has_key?('timezone')
|
85
90
|
tz_value = @logtype_config['timezone']
|
86
91
|
if tz_value.start_with?('+')
|
87
92
|
@s247_tz['hrs'] = Integer('-' + tz_value[1..4])
|
@@ -120,8 +125,8 @@ class Fluent::Site24x7Output < Fluent::Plugin::Output
|
|
120
125
|
if @s247_datetime_format_string.include? 'unix'
|
121
126
|
return (if @s247_datetime_format_string == 'unix' then datetime_string+'000' else datetime_string end)
|
122
127
|
end
|
123
|
-
datetime_string += if
|
124
|
-
if
|
128
|
+
datetime_string += if !@is_year_present then ' '+String(Time.new.year) else '' end
|
129
|
+
if !@is_timezone_present && @logtype_config.has_key?('timezone')
|
125
130
|
@s247_datetime_format_string += '%z'
|
126
131
|
time_zone = String(@s247_tz['hrs'])+':'+String(@s247_tz['mins'])
|
127
132
|
datetime_string += if time_zone.start_with?('-') then time_zone else '+'+time_zone end
|
@@ -150,6 +155,8 @@ class Fluent::Site24x7Output < Fluent::Plugin::Output
|
|
150
155
|
formatted_line.merge!(log_fields)
|
151
156
|
parsed_lines.push(formatted_line)
|
152
157
|
log_size -= removed_log_size
|
158
|
+
else
|
159
|
+
log.debug "pattern not matched regex : #{@s247_custom_regex} and received line : #{line}"
|
153
160
|
end
|
154
161
|
rescue Exception => e
|
155
162
|
log.error "Exception in parse_line #{e.backtrace}"
|
@@ -345,7 +352,7 @@ class Fluent::Site24x7Output < Fluent::Plugin::Output
|
|
345
352
|
end
|
346
353
|
end
|
347
354
|
rescue Exception => e
|
348
|
-
log.error "Exception occurred in sendig logs : #{e}"
|
355
|
+
log.error "Exception occurred in sendig logs : #{e.backtrace}"
|
349
356
|
end
|
350
357
|
end
|
351
358
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-site24x7
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Magesh Rajan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|