fluent-plugin-lm-logs 0.0.9 → 0.0.10

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: cd3e7b9db6e1987cb6c973f5f2158a38cced85cd91f674ab431556212a821ca1
4
- data.tar.gz: 18788379b54ac12b84b1bfa5b3f0d6aa5b0ea61d7e2c59386d36bf581b9c6565
3
+ metadata.gz: 32c86533e9f9438f49366a7696ed52406960782c95324d90c116b8e9d0b90e50
4
+ data.tar.gz: 335dd724cdc88f5c689389010d5c402ec45414af75e9aa3c631d6bb6a983af4e
5
5
  SHA512:
6
- metadata.gz: 0c4777a3d6c39163d779ec794c26d9792a191ee3ed9730043698dc68000b61ea5e81bf8bf0e7c24f7851d4a99cdc1eef6fe22b0ccd335299bc93bea481b77b23
7
- data.tar.gz: e230f2badade41a1126ecc9ea73c0c0aacf62920f41fbcbb063d1ba7dbdbba9a051b4d886b239916d9a3d836f2c54aeb024aebf2107c8f30dbff460a7d86dbc5
6
+ metadata.gz: 5bf86a768794c2c5e028a943d5186bdfe1cbe62c0b74af1651e48af7ab7fdf1f233f53fbe9a8dffd1797eab664b93ff00a0a729d5c8c55a2741672316a0cd564
7
+ data.tar.gz: 5575c2cb4e683bd68c9661013c2e568c639a3f453f745597e319a9726e17bd39bee2644620ee7df114e2188e7f076b057ce58c7acd119380da608d9f31240c53
data/README.md CHANGED
@@ -20,10 +20,10 @@ Create a custom `fluent.conf` or edit the existing one to specify which logs sho
20
20
  # send them to LogicMonitor
21
21
  <match lm.**>
22
22
  @type lm
23
- company_name <account_name>
24
23
  resource_mapping {"<event_key>": "<lm_property>"}
25
- access_id <your_lm_access_id>
26
- access_key <your_lm_access_key>
24
+ company_name <lm_company_name>
25
+ access_id <lm_access_id>
26
+ access_key <lm_access_key>
27
27
  <buffer>
28
28
  @type memory
29
29
  flush_interval 1s
@@ -39,7 +39,7 @@ Sending:
39
39
 
40
40
  `curl -X POST -d 'json={"message":"hello LogicMonitor from fluentd", "event_key":"lm_property_value"}' http://localhost:8888/lm.test`
41
41
 
42
- Returns the event:
42
+ Produces this event:
43
43
  ```
44
44
  {
45
45
  "message": "hello LogicMonitor from fluentd"
@@ -49,9 +49,8 @@ Returns the event:
49
49
  **Note:** Make sure that logs have a message field. Requests sent without a message will not be accepted.
50
50
 
51
51
  ### Kubernetes
52
- Logic Monitor collects k8s logs automatically via FluentD daemonset, It requires a plugin for this. We recommend using [fluent-plugin-kubernetes_metadata_filter](https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter) to collect Kubernetes metadata.
53
-
54
- See the [example](https://github.com/logicmonitor/lm-logs-fluentd/tree/master/Examples/k8s) to forward k8s logs to Logic Monitor.
52
+ The Kubernetes configuration for LM Logs is deployed as a Helm chart.
53
+ See the [LogicMonitor Helm repository](https://github.com/logicmonitor/k8s-helm-charts/tree/master/lm-logs).
55
54
 
56
55
  ### Resource mapping examples
57
56
 
@@ -68,4 +67,5 @@ See the [example](https://github.com/logicmonitor/lm-logs-fluentd/tree/master/Ex
68
67
  | `access_id` | LM API Token access ID. |
69
68
  | `access_key` | LM API Token access key. |
70
69
  | `flush_interval` | Defines the time in seconds to wait before sending batches of logs to LogicMonitor. Default is `60s`. |
71
- | `debug` | When `true`, logs more information to the fluentd console. |
70
+ | `debug` | When `true`, logs more information to the fluentd console. |
71
+ | `force_encoding` | Specify charset when logs contains invalid utf-characters. |
@@ -1,14 +1,14 @@
1
1
  # Unless explicitly stated otherwise all files in this repository are licensed
2
2
  # under the Apache License Version 2.0.
3
- # This product includes software developed at Logic Monitor (https://www.logicmonitor.com).
4
- # Copyright 2020 Logic Monitor, Inc.
3
+ # This product includes software developed at LogicMonitor (https://www.logicmonitor.com).
4
+ # Copyright 2020 LogicMonitor, Inc.
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "fluent-plugin-lm-logs"
8
- spec.version = '0.0.9'
9
- spec.authors = ["Logic Monitor"]
8
+ spec.version = '0.0.10'
9
+ spec.authors = ["LogicMonitor"]
10
10
  spec.email = "rubygems@logicmonitor.com"
11
- spec.summary = "Logic Monitor logs fluentd output plugin"
11
+ spec.summary = "LogicMonitor logs fluentd output plugin"
12
12
  spec.description = "This output plugin sends fluentd records to the configured LogicMonitor account."
13
13
  spec.homepage = "https://www.logicmonitor.com"
14
14
  spec.license = "Apache-2.0"
@@ -5,7 +5,7 @@ require 'uri'
5
5
  require 'digest'
6
6
  require 'json'
7
7
  require 'openssl'
8
- require "base64"
8
+ require 'base64'
9
9
  require 'net/http'
10
10
  require 'net/https'
11
11
 
@@ -25,6 +25,8 @@ module Fluent
25
25
  config_param :resource_mapping, :hash, :default => {"host": "system.hostname", "hostname": "system.hostname"}
26
26
 
27
27
  config_param :debug, :bool, :default => false
28
+
29
+ config_param :force_encoding, :string, :default => ""
28
30
 
29
31
  # This method is called before starting.
30
32
  # 'conf' is a Hash that includes configuration parameters.
@@ -71,6 +73,11 @@ module Fluent
71
73
  resource_map = {}
72
74
  lm_event = {}
73
75
  lm_event["message"] = record["message"]
76
+
77
+ if @force_encoding != ""
78
+ lm_event["message"] = lm_event["message"].force_encoding(@force_encoding).encode("UTF-8")
79
+ end
80
+
74
81
  if record["_lm.resourceId"] == nil
75
82
  @resource_mapping.each do |key, value|
76
83
  k = value
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: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
- - Logic Monitor
7
+ - LogicMonitor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-18 00:00:00.000000000 Z
11
+ date: 2020-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -65,8 +65,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  requirements: []
68
- rubygems_version: 3.1.2
68
+ rubygems_version: 3.1.4
69
69
  signing_key:
70
70
  specification_version: 4
71
- summary: Logic Monitor logs fluentd output plugin
71
+ summary: LogicMonitor logs fluentd output plugin
72
72
  test_files: []