logstash-output-lmlogs 2.0.4 → 2.0.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/CHANGELOG.md +8 -0
- data/README.md +11 -11
- data/lib/logstash/outputs/lmlogs.rb +7 -1
- data/lib/logstash/outputs/version.rb +1 -1
- data/spec/outputs/metadata_spec.rb +1 -2
- 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: af931ee06c45f2ba5c17846c0db06492a7507e3a7f567ab7c2c23b16e0abecda
|
4
|
+
data.tar.gz: 90507dac2334e8328ccf925a720949426f30d4dfd668660f304aad73f91acd0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a75ca7275eefdd7f5c3d1bb08969a74ca3968703b0ec97c449d7ed05f3b617d00a126e8d9bcfe0fb88098f68564390f818bb4e7a40dd495d3cdcc2fa05ee7cc0
|
7
|
+
data.tar.gz: a1f8a084c36e22c3fe287d8d906ef3aa3ef1cae6c3fde6ae6741514b530038644deb8354959ffb4c93fa73e1d637141f3b515e1ceb6272e739610f76b4d3eadf
|
data/CHANGELOG.md
CHANGED
@@ -18,3 +18,11 @@
|
|
18
18
|
- Dont send event metadata by default. Add config include_metadata_keys for including custom metadata
|
19
19
|
## 2.0.1
|
20
20
|
- Fix incomplete json metadata error.
|
21
|
+
## 2.0.2
|
22
|
+
- Added domain support for GovCloud
|
23
|
+
## 2.0.3
|
24
|
+
- Added validation for domain support
|
25
|
+
## 2.0.4
|
26
|
+
- Added resource type in metadata.
|
27
|
+
## 2.0.5
|
28
|
+
- Added support for customizable resource type.
|
data/README.md
CHANGED
@@ -29,17 +29,17 @@ The allowed values for portal_domain are ["logicmonitor.com", "lmgov.us", "qa-lm
|
|
29
29
|
|
30
30
|
## Important options
|
31
31
|
|
32
|
-
| Option
|
33
|
-
|
34
|
-
| batch_size
|
35
|
-
| message_key
|
36
|
-
| lm_property
|
37
|
-
| keep_timestamp
|
38
|
-
| timestamp_is_key
|
39
|
-
| timestamp_key
|
40
|
-
| include_metadata
|
41
|
-
| include_metadata_keys
|
42
|
-
|
32
|
+
| Option | Description | Default |
|
33
|
+
|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|
|
34
|
+
| batch_size | Event batch size to send to LM Logs. | 100 |
|
35
|
+
| message_key | Key that will be used by the plugin as the system key | "message" |
|
36
|
+
| lm_property | Key that will be used by LM to match resource based on property | "system.hostname" |
|
37
|
+
| keep_timestamp | If false, LM Logs will use the ingestion timestamp as the event timestamp | true |
|
38
|
+
| timestamp_is_key | If true, LM Logs will use a specified key as the event timestamp | false |
|
39
|
+
| timestamp_key | If timestamp_is_key is set, LM Logs will use this key in the event as the timestamp | "logtimestamp" |
|
40
|
+
| include_metadata | If true, all metadata fields will be sent to LM Logs | false |
|
41
|
+
| include_metadata_keys | Array of json keys for which plugin looks for these keys and adds as event meatadata. A dot "." can be used to add nested subjson. If config `include_metadata` is set to true, all metadata will be sent regardless of this config. | [] |
|
42
|
+
| resource_type | If a Resource Type is explicitly specified, that value will be statically applied to all ingested logs. If set to `predef.externalResourceType`, the Resource Type will be assigned dynamically based on the `predef.externalResourceType` property set for the specific resource the logs are mapped to in LM. If left blank, the Resource Type field will remain unset in the ingested logs. | "" |
|
43
43
|
See the [source code](lib/logstash/outputs/lmlogs.rb) for the full list of options
|
44
44
|
|
45
45
|
The syntax for `message_key` and `source_key` values are available in the [Logstash Event API Documentation](https://www.elastic.co/guide/en/logstash/current/event-api.html)
|
@@ -110,6 +110,9 @@ class LogStash::Outputs::LMLogs < LogStash::Outputs::Base
|
|
110
110
|
# json keys for which plugin looks for these keys and adds as event meatadata. A dot "." can be used to add nested subjson.
|
111
111
|
config :include_metadata_keys, :validate => :array, :required => false, :default => []
|
112
112
|
|
113
|
+
# Customised resource_type to map logs to existing LM resources
|
114
|
+
config :resource_type, :validate => :string, :required => false
|
115
|
+
|
113
116
|
@@MAX_PAYLOAD_SIZE = 8*1024*1024
|
114
117
|
|
115
118
|
# For developer debugging.
|
@@ -308,7 +311,10 @@ class LogStash::Outputs::LMLogs < LogStash::Outputs::Base
|
|
308
311
|
if @include_metadata
|
309
312
|
lmlogs_event = event_json
|
310
313
|
lmlogs_event.delete("@timestamp") # remove redundant timestamp field
|
311
|
-
|
314
|
+
unless @resource_type.to_s.strip.empty?
|
315
|
+
lmlogs_event["_resource.type"] = @resource_type
|
316
|
+
end
|
317
|
+
|
312
318
|
if lmlogs_event.dig("event", "original") != nil
|
313
319
|
lmlogs_event["event"].delete("original") # remove redundant log field
|
314
320
|
end
|
@@ -76,8 +76,7 @@ describe LogStash::Outputs::LMLogs do
|
|
76
76
|
"nested" => {"nested2" => {"nested3" => "value",
|
77
77
|
"nested3b" => "value"},
|
78
78
|
"nested_ignored" => "somevalue"
|
79
|
-
}
|
80
|
-
"_resource.type"=>"Logstash"
|
79
|
+
}
|
81
80
|
}
|
82
81
|
puts " actual : #{constructed_event} \n expected : #{expected_event}"
|
83
82
|
puts " hash diff : #{Hashdiff.diff(constructed_event,expected_event)}"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-lmlogs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LogicMonitor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-07-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|