|
15 | 15 |
|
16 | 16 | This extension can be used to unmarshall a [Cloud Logging LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry) message type. The extension expects each log to take up 1 line, and it will decode as many logs as log lines received. |
17 | 17 |
|
18 | | -The following configuration options are supported: |
| 18 | +Currently, this extension [can parse the following logs](#supported-log-types) into log record attributes: |
| 19 | +- [Cloud audit logs](https://cloud.google.com/logging/docs/reference/audit/auditlog/rest/Shared.Types/AuditLog) (extension [mapping](#cloud-audit-logs)) |
| 20 | + |
| 21 | +For all others logs, the payload will be placed in the log record attribute. In this case, the following configuration options are supported: |
19 | 22 |
|
20 | 23 | * `handle_json_payload_as` (Optional): This controls how the json payload of the log entry is parsed into the body. |
21 | 24 | The default `json` parses it as standard JSON, while `text` will the put the payload as a single string. |
@@ -64,9 +67,9 @@ The [log entry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEn |
64 | 67 | | `sourceLocation.file` | Log record attribute: `code.file.path` | |
65 | 68 | | `sourceLocation.line` | Log record attribute: `code.line.number` | |
66 | 69 | | `sourceLocation.function` | Log record attribute: `code.function.name` | |
67 | | -| `protoPayload` | Placed on the record body as is | |
68 | | -| `textPayload` | Placed on the record body as is | |
69 | | -| `jsonPayload` | Placed on the record body as is | |
| 70 | +| `protoPayload` | Placed on the record body as is, unless log type is supported | |
| 71 | +| `textPayload` | Placed on the record body as is, unless log type is supported | |
| 72 | +| `jsonPayload` | Placed on the record body as is, unless log type is supported | |
70 | 73 | | `split.uid` | Log record attribute: `gcp.split.uid` | | |
71 | 74 | | `split.index` | Log record attribute: `gcp.split.index` | | |
72 | 75 | | `split.totalSplits` | Log record attribute: `gcp.split.total` | | |
@@ -104,4 +107,52 @@ The severity is mapped from [Google Cloud Log Severity](https://cloud.google.com |
104 | 107 | | `ERROR`(500) | `ERROR`(17) | Error events are likely to cause problems. | |
105 | 108 | | `CRITICAL`(600) | `FATAL`(21) | Critical events cause more severe problems or outages. | |
106 | 109 | | `ALERT`(700) | `FATAL2`(22) | A person must take an action immediately. | |
107 | | -| `EMERGENCY`(800) | `FATAL4`(24) | One or more systems are unusable. | |
| 110 | +| `EMERGENCY`(800) | `FATAL4`(24) | One or more systems are unusable. | |
| 111 | + |
| 112 | +## Supported log types |
| 113 | + |
| 114 | +Currently, these are the log types that are specifically parsed into log record attributes. |
| 115 | + |
| 116 | +### Cloud Audit Logs |
| 117 | + |
| 118 | +See the struct of the Cloud Audit Log payload in [AuditLog](https://cloud.google.com/logging/docs/reference/audit/auditlog/rest/Shared.Types/AuditLog). The fields are mapped this way in the extension: |
| 119 | + |
| 120 | + |
| 121 | +| Original field | Log record attribute | |
| 122 | +|----------------------------------------------------------------------------|---------------------------------------------------------------------| |
| 123 | +| `serviceName` | `gcp.audit.service.name` | |
| 124 | +| `methodName` | `gcp.audit.method.name` | |
| 125 | +| `resourceName` | `gcp.audit.resource.name` | |
| 126 | +| `resourceLocation.currentLocations` | `gcp.audit.resource.location.current` | |
| 127 | +| `resourceLocation.originalLocations` | `gcp.audit.resource.location.original` | |
| 128 | +| `resourceOriginalState` | _Currently not supported_ | |
| 129 | +| `numResponseItems` | `gcp.audit.response.items` | |
| 130 | +| `status.code` | `rpc.jsonrpc.error_code` | |
| 131 | +| `status.message` | `rpc.jsonrpc.error_message` | |
| 132 | +| `status.details` | _Currently not supported_ | |
| 133 | +| `authenticationInfo.principalEmail` | `user.email` | |
| 134 | +| `authenticationInfo.authoritySelector` | `gcp.audit.authentication.authority_selector` | |
| 135 | +| `authenticationInfo.thirdPartyPrincipal` | _Currently not supported_ | |
| 136 | +| `authenticationInfo.serviceAccountKeyName` | `gcp.audit.authentication.service_account.key.name` | |
| 137 | +| `authenticationInfo.serviceAccountDelegationInfo` | _Currently not supported_ | |
| 138 | +| `authenticationInfo.principalSubject` | `user.id` | |
| 139 | +| `authorizationInfo[*].resource` | Item entry `resource` in map `gcp.audit.authorization` | |
| 140 | +| `authorizationInfo[*].permission` | Item entry `permission` in map `gcp.audit.authorization` | |
| 141 | +| `authorizationInfo[*].granted` | Item entry `granted` in map `gcp.audit.authorization`` | |
| 142 | +| `authorizationInfo.resourceAttributes` | _Currently not supported_ | |
| 143 | +| `policyViolationInfo.orgPolicyViolationInfo.payload` | _Currently not supported_ | |
| 144 | +| `policyViolationInfo.orgPolicyViolationInfo.resourceType` | `gcp.audit.policy_violation.resource.type` | |
| 145 | +| `policyViolationInfo.orgPolicyViolationInfo.resourceTags` | `gcp.audit.policy_violation.resource.tags` | |
| 146 | +| `policyViolationInfo.orgPolicyViolationInfo.violationInfo[*].constraint` | Item entry `constraint` in map `gcp.audit.policy_violation.info` | |
| 147 | +| `policyViolationInfo.orgPolicyViolationInfo.violationInfo[*].errorMessage` | Item entry `error_message` in map `gcp.audit.policy_violation.info` | |
| 148 | +| `policyViolationInfo.orgPolicyViolationInfo.violationInfo[*].checkedValue` | Item entry `checked_value` in map `gcp.audit.policy_violation.info` | |
| 149 | +| `policyViolationInfo.orgPolicyViolationInfo.violationInfo[*].policyType` | Item entry `policy_type` in map `gcp.audit.policy_violation.info` | |
| 150 | +| `requestMetadata.callerIp` | `client.address` | |
| 151 | +| `requestMetadata.callerSuppliedUserAgent` | `user_agent.original` | |
| 152 | +| `requestMetadata.callerNetwork` | `gcp.audit.request.caller.network` | |
| 153 | +| `requestMetadata.requestAttributes` | _Currently not supported_ | |
| 154 | +| `requestMetadata.destinationAttributes` | _Currently not supported_ | |
| 155 | +| `request` | _Currently not supported_ | |
| 156 | +| `response` | _Currently not supported_ | |
| 157 | +| `metadata` | _Currently not supported_ | |
| 158 | +| `serviceData` | [GCP Deprecated field]<br>_Currently not supported_ | |
0 commit comments