--- title: Log Entry overview: A template that represents a single runtime log entry. location: https://istio.io/docs/reference/config/template/logentry.html layout: protoc-gen-docs number_of_entries: 3 ---
The logentry template represents an individual entry within a log.
The logentry template represents an individual entry within a log.
When writing the configuration, the value for the fields associated with this template can either be a literal or an expression. Please note that if the datatype of a field is not istio.mixer.adapter.model.v1beta1.Value, then the expression’s inferred type must match the datatype of the field.
Example config:
apiVersion: "config.istio.io/v1alpha2"
kind: logentry
metadata:
name: accesslog
namespace: istio-system
spec:
severity: '"Default"'
timestamp: request.time
variables:
sourceIp: source.ip | ip("0.0.0.0")
destinationIp: destination.ip | ip("0.0.0.0")
sourceUser: source.user | ""
method: request.method | ""
url: request.path | ""
protocol: request.scheme | "http"
responseCode: response.code | 0
responseSize: response.size | 0
requestSize: request.size | 0
latency: response.duration | "0ms"
monitored_resource_type: '"UNSPECIFIED"'
TimeStamp is used inside templates for fields that are of ValueType “TIMESTAMP”
Value is used inside templates for fields that have dynamic types. The actual datatype of the field depends on the datatype of the expression used in the operator configuration.