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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d63b3de1ab7597eba97b4712eeb40ceba5f8c3f9efd0f99f0123bd98ee085be0
4
- data.tar.gz: 2e63421a187f1cdbed504d94caaa421cc00a90790fd52cb44a7b2e9c49ce1a8e
3
+ metadata.gz: af931ee06c45f2ba5c17846c0db06492a7507e3a7f567ab7c2c23b16e0abecda
4
+ data.tar.gz: 90507dac2334e8328ccf925a720949426f30d4dfd668660f304aad73f91acd0e
5
5
  SHA512:
6
- metadata.gz: cf6ad8fc04a9c9f05f61547a0d956e9fe54dd92ef9708ca4508751974bc121e6cb9a771a9b292c8499f41bd30e7eaf5a737c34dc6395efdd3f901ca709994fc4
7
- data.tar.gz: 36ea602ca70119afa88cc8aee70ec4486e4499e14f83068606b22d886614b9581403679370adc4e639f95ed2557fe145661f251d51e2e4c5a84c78d0cb52359c
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 | 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
-
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
- lmlogs_event["_resource.type"]="Logstash"
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LmLogsLogstashPlugin
4
- VERSION = '2.0.4'
4
+ VERSION = '2.0.5'
5
5
  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
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: 2024-12-24 00:00:00.000000000 Z
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