fluent-plugin-lm-logs 0.0.7 → 0.0.8
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 +14 -5
- data/fluent-plugin-lm-logs.gemspec +1 -1
- data/lib/fluent/plugin/out_lm.rb +3 -6
- 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: 321e02b24adb9528c90c7cdddd17ebdbc193dd3abcd0a66cdb6b7eaa1394b78e
|
4
|
+
data.tar.gz: c0ab73b0026f74fde357f5cdb38d1c2c0618b06a2e2389b5ba246d5eee7eb3ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c863145fc51cc9473113c469d81acf6e96a770481b83665b9ed11e15e13fc2c259d6bad983092620813de982ede3f9df74389fdf3e2635f4298d3a1d807c5b4
|
7
|
+
data.tar.gz: b87af1e8f8469d7b365aad2aa670d526f022132b8e7a630caef0e342c7c979db8e47a53e6e2bc79deb07c394c15e1391b1ec40e85f7f33e96f9f3c62dd4e70e9
|
data/README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
|
2
|
+
[](http://badge.fury.io/rb/fluent-plugin-lm-logs)
|
2
3
|
# lm-logs-fluentd (beta)
|
3
4
|
This output plugin sends Fluentd records to the configured LogicMonitor account.
|
4
5
|
|
5
6
|
## Prerequisites
|
6
7
|
|
7
8
|
Install the plugin:
|
8
|
-
* With gem: `gem install lm-logs
|
9
|
-
* For deb packages: `td-agent-gem install lm-logs
|
9
|
+
* With gem: `gem install fluent-plugin-lm-logs`
|
10
|
+
* For deb packages: `td-agent-gem install fluent-plugin-lm-logs`
|
10
11
|
|
11
12
|
Alternatively, you can add `out_lm.rb` to your Fluentd plugins directory.
|
12
13
|
|
@@ -23,7 +24,11 @@ Create a custom `fluent.conf` or edit the existing one to specify which logs sho
|
|
23
24
|
resource_mapping {"<event_key>": "<lm_property>"}
|
24
25
|
access_id <your_lm_access_id>
|
25
26
|
access_key <your_lm_access_key>
|
26
|
-
|
27
|
+
<buffer>
|
28
|
+
@type memory
|
29
|
+
flush_interval 1s
|
30
|
+
chunk_limit_size 5m
|
31
|
+
</buffer>
|
27
32
|
debug false
|
28
33
|
</match>
|
29
34
|
```
|
@@ -43,6 +48,11 @@ Returns the event:
|
|
43
48
|
|
44
49
|
**Note:** Make sure that logs have a message field. Requests sent without a message will not be accepted.
|
45
50
|
|
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.
|
55
|
+
|
46
56
|
### Resource mapping examples
|
47
57
|
|
48
58
|
- `{"message":"Hey!!", "event_key":"lm_property_value"}` with mapping `{"event_key": "lm_property"}`
|
@@ -58,5 +68,4 @@ Returns the event:
|
|
58
68
|
| `access_id` | LM API Token access ID. |
|
59
69
|
| `access_key` | LM API Token access key. |
|
60
70
|
| `flush_interval` | Defines the time in seconds to wait before sending batches of logs to LogicMonitor. Default is `60s`. |
|
61
|
-
| `debug` | When `true`, logs more information to the fluentd console. |
|
62
|
-
|
71
|
+
| `debug` | When `true`, logs more information to the fluentd console. |
|
data/lib/fluent/plugin/out_lm.rb
CHANGED
@@ -109,12 +109,9 @@ module Fluent
|
|
109
109
|
request.body = body
|
110
110
|
|
111
111
|
resp = http.request(request)
|
112
|
-
if @debug
|
113
|
-
log.info "
|
114
|
-
|
115
|
-
|
116
|
-
if !resp.kind_of? Net::HTTPSuccess
|
117
|
-
log.error "Error sending batch #{resp.body}"
|
112
|
+
if @debug || (!resp.kind_of? Net::HTTPSuccess)
|
113
|
+
log.info "Status code #{resp.code}"
|
114
|
+
log.info "Request Id #{resp.header['x-request-id']}"
|
118
115
|
end
|
119
116
|
end
|
120
117
|
|
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.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Logic Monitor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|