Telemetry - LogPipeline

The logpipeline.telemetry.kyma-project.io CustomResourceDefinition (CRD) is a detailed description of the kind of data and the format used to filter and ship application logs in Kyma. To get the up-to-date CRD and show the output in the YAML format, run this command:

Click to copy
kubectl get crd logpipeline.telemetry.kyma-project.io -o yaml

Sample custom resource

The following LogPipeline object defines a pipeline integrating with the HTTP/JSON-based output using basic authentication, excluding application logs emitted by istio-proxy containers.

Click to copy
apiVersion: telemetry.kyma-project.io/v1alpha1
kind: LogPipeline
metadata:
name: custom-fluentd
spec:
input:
application:
containers:
exclude:
- istio-proxy
namespaces: {}
output:
http:
dedot: true
host:
valueFrom:
secretKeyRef:
key: Fluentd-endpoint
name: custom-fluentd
namespace: default
password:
valueFrom:
secretKeyRef:
key: Fluentd-password
name: custom-fluentd
namespace: default
tls: {}
uri: /customindex/kyma
user:
valueFrom:
secretKeyRef:
key: Fluentd-username
name: custom-fluentd
namespace: default
status:
conditions:
- lastTransitionTime: "2022-11-25T12:38:36Z"
reason: FluentBitDaemonSetRestarted
type: Pending
- lastTransitionTime: "2022-11-25T12:39:26Z"
reason: FluentBitDaemonSetRestartCompleted
type: Running

For further LogPipeline examples, see the samples directory.

Custom resource parameters

spec attribute

For details, see the LogPipeline specification file.

ParameterTypeDescription
inputobjectDefinition where to collect logs, including selector mechanisms.
input.applicationobjectInput type for application logs collection.
input.application.namespacesobjectProvides selectors for Namespaces. Selectors are mutually exclusive.
input.application.namespaces.include[]stringList of Namespaces from which logs are collected.
input.application.namespaces.exclude[]stringList of Namespaces to exclude during log collection from all Namespaces.
input.application.namespaces.systembooleanSet to true if collecting from all Namespaces must also include system Namespaces.
input.application.containers[]stringProvides selectors for containers. Selectors are mutually exclusive.
input.application.containers.include[]stringList of containers to collect from.
input.application.containers.exclude[]stringList of containers to exclude.
input.application.keepAnnotationsbooleanIndicates whether to keep all Kubernetes annotations. Default is false.
input.application.dropLabelsbooleanIndicates whether to drop all Kubernetes labels. Default is false.
filters[]objectList of Fluent Bit filters to apply to the logs processed by the pipeline. Filters are executed in sequence, as defined. They are executed before logs are buffered, and with that, are not executed on retries.
filters[].customstringFilter definition in the Fluent Bit syntax. Note: If you use a custom output, you put the LogPipeline in unsupported mode.
outputobjectFluent Bit output where you want to push the logs. Only one output can be specified.
output.grafana-lokiobjectFluent Bit grafana-loki output. Note: This output is considered legacy and is only provided for backward compatibility with the deprecated in-cluster Loki instance. It might not be compatible with the latest Loki versions. For integration with a custom Loki installation use the custom output with the name loki instead, see also this tutorial.
output.grafana-loki.urlobjectGrafana Loki URL.
output.grafana-loki.url.valuestringURL value.
output.grafana-loki.url.valueFrom.secretKeyRefobjectReference to a key in a Secret. You must provide name and namespace of the Secret, as well as the name of the key.
output.grafana-loki.labelsmapstringstringLabels to set for each log record.
output.grafana-loki.removeKeys[]stringAttributes to be removed from a log record.
output.httpobjectMaps to a Fluent Bit http output.
output.http.compressstringPayload compression mechanism.
output.http.dedotbooleanIf true, replaces dots with underscores ("dedotting") in the log field names kubernetes.annotations and kubernetes.labels. Default is false.
output.http.formatstringData format to be used in the HTTP request body. Default is json.
output.http.hostobjectIP address or hostname of the target HTTP server.
output.http.host.valuestringHost value, can contain references to Secret values.
output.http.host.valueFrom.secretKeyRefobjectReference to a key in a Secret. You must provide name and namespace of the Secret, as well as the name of the key.
output.http.passwordobjectBasic Auth password.
output.http.password.valuestringPassword value, can contain references to Secret values.
output.http.password.valueFrom.secretKeyRefobjectReference to a key in a Secret. You must provide name and namespace of the Secret, as well as the name of the key.
output.http.portstringTCP port of the target HTTP server. Default is 443.
output.http.tlsobjectTLS Configuration of the HTTP target server.
output.http.tls.disabledbooleanIndicates if TLS is disabled or enabled. Default is false.
output.http.tls.skipCertificateValidationbooleanIf true, the validation of certificates is skipped. Default is false.
output.http.uristringURI for the target HTTP server. Fluent Bit Default is /.
output.http.userobjectBasic Auth username.
output.http.user.valuestringUsername value, can contain references to Secret values.
output.http.user.valueFrom.secretKeyRefobjectReference to a key in a Secret. You must provide name and namespace of the Secret, as well as the name of the key.
output.customstringAny other Fluent Bit output specified in the Fluent Bit configuration syntax. Note: If you use a custom output, you put the LogPipeline in unsupported mode.
variables[]objectA list of mappings from Kubernetes Secret keys to environment variables. Mapped keys are mounted as environment variables, so that they are available as Variables in the sections.
variables[].namestringName of the variable to map.
variables[].valueFrom.secretKeyRefobjectReference to a key in a Secret. You must provide name and namespace of the Secret, as well as the name of the key.
files[]objectA list of text snippets that are mounted as files to Fluent Bit, so that they are available for reference in filters and outputs. The mounted snippet is available under the /files folder.
files[].namestringThe file name under which the snippet is mounted. The resulting path will be /files/<name>.
files[].contentstringThe actual text snippet to mount as file.

status attribute

For details, see the LogPipeline specification file.

ParameterTypeDescription
conditions[]objectAn array of conditions describing the status of the pipeline.
conditions[].lastTransitionTime[]objectAn array of conditions describing the status of the pipeline.
conditions[].reason[]objectAn array of conditions describing the status of the pipeline.
conditions[].typeenumThe possible transition types are:- Running: The instance is ready and usable.- Pending: The pipeline is being activated.
unsupportedModeboolIs active when the LogPipeline uses a custom output or filter; see unsupported mode.