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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10b17ee7b034c6e827b5213c154e07ac6098f5976ef6614c6b1b6922a156e996
4
- data.tar.gz: 77a5ff349177a50024a8223ce723603580eaedefed302e30674f94b924def144
3
+ metadata.gz: a671fc16f4b05377a3e332be35f968e8802533c06c459fb2e15c074931285a58
4
+ data.tar.gz: ca4416e34b22f5a0f0d8db00cb64affd098dcc3faad39e3c26fea2294c51e340
5
5
  SHA512:
6
- metadata.gz: b17a8137c85fab6ce5e7df780fe601428f74697c94578155be2048f93a1fde9c932515635baf6ee0bc26b286c0bfb7c8eeb3668b8b82443e086998d29dce487e
7
- data.tar.gz: 694caa8636745a60a1630e2d40e5f3f24da5bb7dfae6a9a3c48def7f93c24c7904e0b101e786c8cd25ebd297e4ccd799b46bd22ca37b15c4b362da4d32799e61
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, severity=`DEFAULT` would be added to log. default `false`. |
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.5'
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["severity"] and @use_default_severity
109
- filteredRecord["severity"] = "DEFAULT"
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.5
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-06-13 00:00:00.000000000 Z
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: []