Skip to content

Commit

Permalink
site: document support for custom Envoy JSON Fields
Browse files Browse the repository at this point in the history
follow-up for projectcontour#3059
  • Loading branch information
Alex Standke committed Oct 28, 2020
1 parent 64d43a5 commit 465e600
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions site/_guides/structured-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ To enable the feature you have two options:

## Customizing logged fields

To customize the logged fields, add a `json-fields` list of strings to your config file.
These strings must be options from the [list of valid fields][1].
If the `json-fields` key is not specified, the [default fields][2] will be configured.
Field names not in that list will be silently dropped. (This is not ideal, watch [#1507][3] for updates.)
To customize the logged fields, add a `json-fields` list of strings to your
config file. These strings must be options from the [list of valid fields][1].
If the `json-fields` key is not specified, the [default fields][2] will be
configured. To use Envoy supported logging operators that are not part of this
simplified list, they can be specified as key/value pairs in the form
`fieldName=%OPERATOR(...)%`. Unknown field names in non key/value fields will
result in validation errors, as will unknown operators in key/value fields.

The [example config file][4] contains the full list of fields as well.

Expand All @@ -41,6 +44,7 @@ json-fields:
- "authority"
- "bytes_received"
- "bytes_sent"
- "customer_id=%REQ(X-CUSTOMER-ID)%"
- "downstream_local_address"
- "downstream_remote_address"
- "duration"
Expand Down

0 comments on commit 465e600

Please sign in to comment.