-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from logicmonitor/feature/resource_mapping
feature/resource_mapping: Modified: Changing the resource mapping to…
- Loading branch information
Showing
7 changed files
with
65 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
|
||
Gem::Specification.new do |spec| | ||
spec.name = "fluent-plugin-lm-logs-gcp" | ||
spec.version = '1.0.0' | ||
spec.version = '1.0.1' | ||
spec.authors = ["LogicMonitor"] | ||
spec.email = "[email protected]" | ||
spec.summary = "LogicMonitor with GCP logs fluentd filter plugin" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,75 +104,12 @@ def filter(messages, conf = '') | |
"system.cloud.category" => 'GCP/LMAccount' | ||
}, | ||
"message" =>"{\"@type\": \"type.googleapis.com/google.cloud.audit.AuditLog\",\"status\": {\"message\": \"Instance Group Manager 'projects/272452262635/zones/us-central1-c/instanceGroupManagers/aef-backend-20180822t164014-00' initiated recreateInstance on instance 'projects/272452262635/zones/us-central1-c/instances/aef-backend-20180822t164014-b75j'. Reason: instance's current action is VERIFYING, but health status is TIMEOUT.\"},\"authenticationInfo\": {\"principalEmail\": \"[email protected]\"},\"serviceName\": \"compute.googleapis.com\",\"methodName\": \"compute.instances.repair.recreateInstance\",\"resourceName\": \"projects/development-198123/zones/us-central1-c/instances/aef-backend-20180822t164014-b75j\",\"request\": {\"@type\": \"type.googleapis.com/compute.instances.repair.recreateInstance\"}}", | ||
"insertId" => "bdl1yydsszy", | ||
"resource" => { | ||
"type" => "gce_instance", | ||
"labels" => { | ||
"zone" => "us-central1-c", | ||
"project_id" => "development-198123", | ||
"instance_id" => "5229353360185505344" | ||
} | ||
}, | ||
"timestamp" => "2021-04-27T06:44:51.535974Z", | ||
"severity" => "INFO", | ||
"logName" => "projects/development-198123/logs/cloudaudit.googleapis.com%2Fsystem_event", | ||
"operation" => { | ||
"id" => "repair-1619505891524-5c0ee99603e9a-862341d5-24923c3c", | ||
"producer" => "compute.instances.repair.recreateInstance", | ||
"first" => true, | ||
"last" => true | ||
}, | ||
"receiveTimestamp" => "2021-04-27T06:44:51.904218698Z", | ||
"protoPayload" => { | ||
"@type" => "type.googleapis.com/google.cloud.audit.AuditLog", | ||
"status" => { | ||
"message" => "Instance Group Manager 'projects/272452262635/zones/us-central1-c/instanceGroupManagers/aef-backend-20180822t164014-00' initiated recreateInstance on instance 'projects/272452262635/zones/us-central1-c/instances/aef-backend-20180822t164014-b75j'. Reason: instance's current action is VERIFYING, but health status is TIMEOUT." | ||
}, | ||
"authenticationInfo" => { | ||
"principalEmail" => "[email protected]" | ||
}, | ||
"serviceName" => "compute.googleapis.com", | ||
"methodName" => "compute.instances.repair.recreateInstance", | ||
"resourceName" => "projects/development-198123/zones/us-central1-c/instances/aef-backend-20180822t164014-b75j", | ||
"request" => { | ||
"@type" => "type.googleapis.com/compute.instances.repair.recreateInstance" | ||
} | ||
} | ||
"timestamp" => "2021-04-27T06:44:51.535974Z" | ||
}, | ||
{ | ||
"_lm.resourceId" => {}, | ||
"message" =>"{\"@type\": \"type.googleapis.com/google.cloud.audit.AuditLog\",\"status\": {\"message\": \"Instance Group Manager 'projects/272452262635/zones/us-central1-c/instanceGroupManagers/aef-backend-20180822t164014-00' initiated recreateInstance on instance 'projects/272452262635/zones/us-central1-c/instances/aef-backend-20180822t164014-b75j'. Reason: instance's current action is VERIFYING, but health status is TIMEOUT.\"},\"authenticationInfo\": {\"principalEmail\": \"[email protected]\"},\"serviceName\": \"compute.googleapis.com\",\"methodName\": \"compute.instances.repair.recreateInstance\",\"resourceName\": \"projects/development-198123/zones/us-central1-c/instances/aef-backend-20180822t164014-b75j\",\"request\": {\"@type\": \"type.googleapis.com/compute.instances.repair.recreateInstance\"}}", | ||
"resource" => { | ||
"type" => "gce_instance", | ||
"labels" => { | ||
"project_id" => "development-198123" | ||
} | ||
}, | ||
"protoPayload" => { | ||
"status" => { | ||
"message" => "Instance Group Manager 'projects/272452262635/zones/us-central1-c/instanceGroupManagers/aef-backend-20180822t164014-00' initiated recreateInstance on instance 'projects/272452262635/zones/us-central1-c/instances/aef-backend-20180822t164014-b75j'. Reason: instance's current action is VERIFYING, but health status is TIMEOUT." | ||
}, | ||
"authenticationInfo" => { | ||
"principalEmail" => "[email protected]" | ||
}, | ||
"serviceName" => "compute.googleapis.com", | ||
"methodName" => "compute.instances.repair.recreateInstance", | ||
"resourceName" => "projects/development-198123/zones/us-central1-c/instances/aef-backend-20180822t164014-b75j", | ||
"request" => { | ||
"@type" => "type.googleapis.com/compute.instances.repair.recreateInstance" | ||
} | ||
}, | ||
"insertId" => "bdl1yydsszy", | ||
"timestamp" => "2021-04-27T06:44:51.535974Z", | ||
"severity" => "INFO", | ||
"logName" => "projects/development-198123/logs/cloudaudit.googleapis.com%2Fsystem_event", | ||
"operation" => { | ||
"id" => "repair-1619505891524-5c0ee99603e9a-862341d5-24923c3c", | ||
"producer" => "compute.instances.repair.recreateInstance", | ||
"first" => true, | ||
"last" => true | ||
}, | ||
"receiveTimestamp" => "2021-04-27T06:44:51.904218698Z" | ||
"timestamp" => "2021-04-27T06:44:51.535974Z" | ||
}] | ||
actual = filter(messages) | ||
actual.each_with_index { |val, index| assert_equal(expected[index]["_lm.resourceId"], actual[index]["_lm.resourceId"]) } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.