Log
Overview
The Log policy action allows you to leverage ngrok's eventing system to introduce observability into your traffic policy.
Example
- YAML
- JSON
# snippet
---
actions:
- type: "log"
config:
metadata:
message: "Invalid TLS Version"
edge_id: "edghts_2bhsN2VP8W4pTkaMSrhyj0SRf8J"
edge_route_id: "edghtsrt_2bhsN5u05QQ1MRrI3XbpDQMFSE7"
// snippet
{
"actions": [
{
"type": "log",
"config": {
"metadata": {
"message": "Invalid TLS Version",
"edge_id": "edghts_2bhsN2VP8W4pTkaMSrhyj0SRf8J",
"edge_route_id": "edghtsrt_2bhsN5u05QQ1MRrI3XbpDQMFSE7"
}
}
}
]
}
Behavior
When this action is executed, the specified metadata will be collected on the tcp_connection_closed.v0 event
under traffic_policy.logs
.
Reference
Supported Directions
- Inbound
Configuration
Type |
---|
log |
Parameter | Description | |
---|---|---|
metadata | Map<string, any> | A map of metadata that you would like to be included in the details of your log event. |
Action Result Variables
The following variables are available following the invocation of this action.
Name | Type | Description |
---|---|---|
actions.ngrok.log.metadata | map[string]string | The key value map of the metadata values. |