fluent-plugin-lm-logs-gcp 1.0.5 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/fluent-plugin-lm-logs-gcp.gemspec +1 -1
- data/lib/fluent/plugin/filter_gcplm.rb +5 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a671fc16f4b05377a3e332be35f968e8802533c06c459fb2e15c074931285a58
|
4
|
+
data.tar.gz: ca4416e34b22f5a0f0d8db00cb64affd098dcc3faad39e3c26fea2294c51e340
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7011b54f3755f971eda3f273ad9b53db28b29db0b741f8d5391fa40d5cb089dd5027725e38d4ddddba4a6a7fd3f8acef874c5f12cdd0c8023fc690ccf970208e
|
7
|
+
data.tar.gz: 93ccea85e676715def658ce3fec3df4f88cdece0a08b6c2684127d8f5bfd6624f16d169344305966aa6bdf183a6996d688f1cfddbde8d82940bdde49047e311a
|
data/README.md
CHANGED
@@ -12,4 +12,4 @@ This filter plugin is provided for mapping the logs coming from GCP pubsub to '_
|
|
12
12
|
| Property | Description |
|
13
13
|
| --- | --- |
|
14
14
|
| `metadata_keys` | Array of keys to be added as metadata. Filter will look for these keys in fluentd record and extract those if exist. in case of nested json, whole sub json would be added. default ` ["severity", "logName", "labels", "resource.type", "resource.labels", "httpRequest"] ` . few keys will be renamed as part of metadata standardization in Logicmonitor : ` {"trace" => "trace_id", "spanId" => "span_id","resource.type" => "_type"}`|
|
15
|
-
| `use_default_severity` | When `true`, and log record does not have severity,
|
15
|
+
| `use_default_severity` | When `true`, and log record does not have severity, log_level=`DEFAULT` would be added to log. default `false`. |
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "fluent-plugin-lm-logs-gcp"
|
8
|
-
spec.version = '1.0.
|
8
|
+
spec.version = '1.0.7'
|
9
9
|
spec.authors = ["LogicMonitor"]
|
10
10
|
spec.email = "rubygems@logicmonitor.com"
|
11
11
|
spec.summary = "LogicMonitor with GCP logs fluentd filter plugin"
|
@@ -4,7 +4,7 @@ module Fluent::Plugin
|
|
4
4
|
class GCPLMFilter < Filter
|
5
5
|
Fluent::Plugin.register_filter('gcplm', self)
|
6
6
|
|
7
|
-
METADATA_KEYS_TO_RENAME = {"trace" => "trace_id", "spanId" => "span_id","resource.type" => "_type"}.freeze
|
7
|
+
METADATA_KEYS_TO_RENAME = {"trace" => "trace_id", "spanId" => "span_id","resource.type" => "_type", "severity" => "log_level"}.freeze
|
8
8
|
STATIC_METADATA = {"_integration" => "gcp"}
|
9
9
|
|
10
10
|
config_param :metadata_keys, :array, default: ["severity", "logName", "labels", "resource.type", "resource.labels", "httpRequest"], value_type: :string
|
@@ -76,6 +76,8 @@ module Fluent::Plugin
|
|
76
76
|
resourceMap = {"system.gcp.resourcename" => record.dig("resource", "labels", "service_name"), "system.cloud.category" => 'GCP/CloudRun'}
|
77
77
|
when 'cloud_composer_environment'
|
78
78
|
resourceMap = {"system.gcp.resourcename" => "projects/" + project_id + "/locations/" + record.dig("resource", "labels", "location") + "/environments/" + record.dig("resource", "labels", "environment_name"), "system.cloud.category" => 'GCP/CloudComposer'}
|
79
|
+
when 'k8s_container'
|
80
|
+
resourceMap = {"system.gcp.resourcename" => record.dig("labels", "compute.googleapis.com/resource_name"), "system.cloud.category" => 'GCP/ComputeEngine'}
|
79
81
|
end
|
80
82
|
|
81
83
|
if(record.key?("protoPayload") && record.dig('protoPayload', '@type') == "type.googleapis.com/google.cloud.audit.AuditLog")
|
@@ -105,8 +107,8 @@ module Fluent::Plugin
|
|
105
107
|
STATIC_METADATA.each { | key, value| filteredRecord[key] = value }
|
106
108
|
|
107
109
|
# Add default severity if does not exist
|
108
|
-
if !filteredRecord["
|
109
|
-
filteredRecord["
|
110
|
+
if !filteredRecord["log_level"] and @use_default_severity
|
111
|
+
filteredRecord["log_level"] = "DEFAULT"
|
110
112
|
end
|
111
113
|
|
112
114
|
filteredRecord
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-lm-logs-gcp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
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-
|
11
|
+
date: 2023-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -64,7 +64,7 @@ licenses:
|
|
64
64
|
metadata:
|
65
65
|
source_code_uri: https://github.com/logicmonitor/lm-logs-fluentd-gcp-filter
|
66
66
|
documentation_uri: https://www.rubydoc.info/gems/lm-logs-fluentd-gcp-filter
|
67
|
-
post_install_message:
|
67
|
+
post_install_message:
|
68
68
|
rdoc_options: []
|
69
69
|
require_paths:
|
70
70
|
- lib
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubygems_version: 3.4.10
|
83
|
-
signing_key:
|
83
|
+
signing_key:
|
84
84
|
specification_version: 4
|
85
85
|
summary: LogicMonitor with GCP logs fluentd filter plugin
|
86
86
|
test_files: []
|