Example
- Response body
- Stack trace
- Before
- After
Recommended enforcement
Open PRs
Fix at the source. The developer who added this logging should decide what to keep.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Response bodies, large objects, and data blobs in logs
{
"@timestamp": "2024-01-15T10:30:00Z",
"service.name": "order-service",
"event": "order.created",
"order_id": "ORD-12345",
"http.response.body": "{\"id\":\"ORD-12345\",\"items\":[{\"sku\":\"SKU-001\",\"name\":\"Widget Pro\",\"quantity\":2,\"price\":29.99},{\"sku\":\"SKU-002\",\"name\":\"Gadget Plus\",\"quantity\":1,\"price\":49.99}],\"shipping\":{\"method\":\"express\",\"address\":{\"street\":\"123 Main St\",\"city\":\"Seattle\",\"state\":\"WA\",\"zip\":\"98101\",\"country\":\"US\"}},\"billing\":{\"method\":\"card\",\"last4\":\"4242\"},\"totals\":{\"subtotal\":109.97,\"shipping\":12.99,\"tax\":10.45,\"total\":133.41}}"
}
{
"@timestamp": "2024-01-15T10:30:00Z",
"service.name": "order-service",
"event": "order.created",
"order_id": "ORD-12345"
}
id: remove-response-body-order-service
name: Remove response body from order-service
description: Drop full HTTP response body. The order_id is sufficient for lookup.
log:
match:
- resource_attribute: service.name
exact: order-service
- log_attribute: event
exact: order.created
transform:
remove:
- log_attribute: http.response.body
{
"@timestamp": "2024-01-15T10:30:00Z",
"service.name": "api-service",
"severity_text": "ERROR",
"error.message": "Connection refused",
"error.stack_trace": "Error: Connection refused\n at Socket.connect (net.js:1141:16)\n at DBClient.connect (db.js:89:12)\n ... 200 more lines ..."
}
{
"@timestamp": "2024-01-15T10:30:00Z",
"service.name": "api-service",
"severity_text": "ERROR",
"error.message": "Connection refused"
}