Edge Delta Loki Destination
2 minute read
Overview
The Loki destination node delivers logs and patterns to a Loki service.
- incoming_data_types: cluster_pattern_and_sample, log, custom
Example Configuration
- name: my_loki_output
type: loki_output
endpoint: http://localhost:3100/loki/api/v1/push
user: 123456
api_key: my_api_key
Required Parameters
name
A descriptive name for the node. This is the name that will appear in Visual Pipelines and you can reference this node in the YAML using the name. It must be unique across all nodes. It is a YAML list element so it begins with a -
and a space followed by the string. It is a required parameter for all nodes.
nodes:
- name: <node name>
type: <node type>
type: loki_output
The type
parameter specifies the type of node being configured. It is specified as a string from a closed list of node types. It is a required parameter.
nodes:
- name: <node name>
type: <node type>
endpoint
The endpoint
parameter is the full URL to the Loki instance where logs will be pushed. This is a required parameter to enable communication with Loki.
- name: my_loki_output
type: loki_output
endpoint: http://localhost:3100/loki/api/v1/push
user: 123456
api_key: my_api_key
user
The user
attribute specifies the user ID for authorization with the Loki service. This parameter is required.
- name: my_loki_output
type: loki_output
endpoint: http://localhost:3100/loki/api/v1/push
user: 123456
api_key: my_api_key
api_key
The api_key
is used for API authorization along with the user
parameter. This parameter is required. Sensitive information like API keys should be stored securely.
- name: my_loki_output
type: loki_output
endpoint: http://localhost:3100/loki/api/v1/push
user: 123456
api_key: my_api_key
Optional Parameters
labels
The labels
parameter is used to define labels to append to logs. This is useful for differentiating between log sources, for example. Labels are defined with a name and a path:
name:
Loki restricts label names to ASCII letters, digits, and underscores.path:
A path to the source field containing the label value. See here for information on how to reference fields. You can also use CEL macros so the value can be extracted from data. Labels are optional.
nodes:
- name: my_loki_output
type: loki_output
endpoint: http://localhost:3100/loki/api/v1/push
user: 123456
api_key: my_api_key
labels:
- name: k8s_namespace
path: item["resource"]["k8s.namespace.name"]
- name: k8s_container_name
path: item["resource"]["k8s.container.name"]
- name: k8s_pod_name
path: item["resource"]["k8s.pod.name"]
- name: k8s_deployment_name
path: item["resource"]["k8s.deployment.name"]
- name: k8s_daemonset_name
path: item["resource"]["k8s.daemonset.name"]
- name: k8s_statefulset_name
path: item["resource"]["k8s.statefulset.name"]
- name: k8s_replicaset_name
path: item["resource"]["k8s.replicaset.name"]
- name: k8s_cronjob_name
path: item["resource"]["k8s.cronjob.name"]
- name: k8s_job_name
path: item["resource"]["k8s.job.name"]
- name: platform_label
path: item["attributes"]["platform"]
- name: platform_label
path: item["attributes"]["status_code"]
Note: The following Edge Delta fields are not passed by the output unless explicitly set as labels:
item["resource"]["__group_name"]
item["resource"]["__logical_source"]
item["resource"]["__short_src_name"]
item["resource"]["__src_name"]
See Also: