Log Entry

The logentry template represents an individual entry within a log.

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"'

Template

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.

FieldTypeDescription
variablesmap<string, istio.mixer.adapter.model.v1beta1.Value>

Variables that are delivered for each log entry.

timestampistio.mixer.adapter.model.v1beta1.TimeStamp

Timestamp is the time value for the log entry

severitystring

Severity indicates the importance of the log entry.

monitoredResourceTypestring

Optional. An expression to compute the type of the monitored resource this log entry is being recorded on. If the logging backend supports monitored resources, these fields are used to populate that resource. Otherwise these fields will be ignored by the adapter.

monitoredResourceDimensionsmap<string, istio.mixer.adapter.model.v1beta1.Value>

Optional. A set of expressions that will form the dimensions of the monitored resource this log entry is being recorded on. If the logging backend supports monitored resources, these fields are used to populate that resource. Otherwise these fields will be ignored by the adapter.

istio.mixer.adapter.model.v1beta1.TimeStamp

TimeStamp is used inside templates for fields that are of ValueType “TIMESTAMP”

FieldTypeDescription
valuegoogle.protobuf.Timestamp

TimeStamp encoded as google.protobuf.Timestamp.

istio.mixer.adapter.model.v1beta1.Value

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.

FieldTypeDescription
stringValuestring (oneof)

Used for values of type STRING

int64Valueint64 (oneof)

Used for values of type INT64

doubleValuedouble (oneof)

Used for values of type DOUBLE

boolValuebool (oneof)

Used for values of type BOOL

ipAddressValueistio.mixer.adapter.model.v1beta1.IPAddress (oneof)

Used for values of type IPAddress

timestampValueistio.mixer.adapter.model.v1beta1.TimeStamp (oneof)

Used for values of type TIMESTAMP

durationValueistio.mixer.adapter.model.v1beta1.Duration (oneof)

Used for values of type DURATION

emailAddressValueistio.mixer.adapter.model.v1beta1.EmailAddress (oneof)

Used for values of type EmailAddress

dnsNameValueistio.mixer.adapter.model.v1beta1.DNSName (oneof)

Used for values of type DNSName

uriValueistio.mixer.adapter.model.v1beta1.Uri (oneof)

Used for values of type Uri