fluent-plugin-lm-logs 1.0.5 → 1.0.6

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
  SHA256:
3
- metadata.gz: d615e41f382455dbcae73e2449a311c57bf2a9acc24e55d27127737e162a9469
4
- data.tar.gz: e789739f1b6407674a89cb0fe6f54a91c5fdd6936158952113b53d5bf0f0a6fd
3
+ metadata.gz: 7b7c2e1fc4c9c42e768327c9dead6b9eaa9f8a77b44ea7697b51306617e2702a
4
+ data.tar.gz: 4aee4bdb365b8c7efd52c2aa33ed8d5b0f83cb3ca7e551986062721b33faea24
5
5
  SHA512:
6
- metadata.gz: c99d630c5cf20b75afd1759ca6628dbe833e3cd3ff2d98c481651295f4dc8bae538e72dbf7f35acddcf23643385fc76e3463df35c9adb39494e2140987568733
7
- data.tar.gz: 74d559060251b796f8ed252eab5a3df58daddf9f0cc467cefc266ff4f7b4f2944026390292b938eb8248c9cb07bd3f4abc0a039ba6c40dafb77109ad4a3fd9c1
6
+ metadata.gz: f96d200ceb54255e82e09248179b442032c96a1f6bf28efeb410a8a5b4f9423ad5c08815f71cc9a47b2f03c9bbaeef258cdfe52b435b168e65cdaa0bb832adbd
7
+ data.tar.gz: 8dbfcce551188386379bb479021e24dc8b027f6edba4fd0f87ef17ef4eda1535010a0eaf5ca973fda304cfed339a4b0e53306e9fda012336686cc70c75d5b868
data/README.md CHANGED
@@ -71,6 +71,7 @@ See the [LogicMonitor Helm repository](https://github.com/logicmonitor/k8s-helm-
71
71
  | `force_encoding` | Specify charset when logs contains invalid utf-8 characters. |
72
72
  | `include_metadata` | When `true`, appends additional metadata to the log. default `false`. |
73
73
  | `device_less_logs` | When `true`, do not map log with any resource. record must have `service` when `true`. default `false`. |
74
+ | `http_proxy` | http proxy string eg. `http://user:pass@proxy.server:port`. Default `nil` |
74
75
 
75
76
 
76
77
 
@@ -46,6 +46,8 @@ module Fluent
46
46
  config_param :version_id, :string, :default => "version_id"
47
47
 
48
48
  config_param :device_less_logs, :bool, :default => false
49
+
50
+ config_param :http_proxy, :string, :default => nil
49
51
 
50
52
  # This method is called before starting.
51
53
  # 'conf' is a Hash that includes configuration parameters.
@@ -58,7 +60,13 @@ module Fluent
58
60
  # Open sockets or files here.
59
61
  def start
60
62
  super
61
- @http_client = Net::HTTP::Persistent.new name: "fluent-plugin-lm-logs"
63
+ proxy_uri = :ENV
64
+ if @http_proxy
65
+ proxy_uri = URI.parse(http_proxy)
66
+ elsif ENV['HTTP_PROXY'] || ENV['http_proxy']
67
+ log.info("Using HTTP proxy defined in environment variable")
68
+ end
69
+ @http_client = Net::HTTP::Persistent.new name: "fluent-plugin-lm-logs", proxy: proxy_uri
62
70
  @http_client.override_headers["Content-Type"] = "application/json"
63
71
  @http_client.override_headers["User-Agent"] = log_source + "/" + LmLogsFluentPlugin::VERSION
64
72
  @url = "https://#{@company_name}.logicmonitor.com/rest/log/ingest"
@@ -195,9 +203,8 @@ module Fluent
195
203
  end
196
204
 
197
205
  resp = @http_client.request @uri, request
198
-
199
- if @debug || (!resp.kind_of? Net::HTTPSuccess)
200
- log.info "Status code:#{resp.code} Request Id:#{resp.header['x-request-id']}"
206
+ if @debug || resp.kind_of?(Net::HTTPMultiStatus) || !resp.kind_of?(Net::HTTPSuccess)
207
+ log.info "Status code:#{resp.code} Request Id:#{resp.header['x-request-id']} message:#{resp.body}"
201
208
  end
202
209
  end
203
210
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LmLogsFluentPlugin
4
- VERSION = '1.0.5'
4
+ VERSION = '1.0.6'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-lm-logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - LogicMonitor
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-22 00:00:00.000000000 Z
11
+ date: 2023-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -65,7 +65,7 @@ licenses:
65
65
  metadata:
66
66
  source_code_uri: https://github.com/logicmonitor/lm-logs-fluentd
67
67
  documentation_uri: https://www.rubydoc.info/gems/lm-logs-fluentd
68
- post_install_message:
68
+ post_install_message:
69
69
  rdoc_options: []
70
70
  require_paths:
71
71
  - lib
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
81
  version: '0'
82
82
  requirements: []
83
83
  rubygems_version: 3.4.10
84
- signing_key:
84
+ signing_key:
85
85
  specification_version: 4
86
86
  summary: LogicMonitor logs fluentd output plugin
87
87
  test_files: []