Stage labels alloy. process "add_dynamic_label" { stage. 0. label_drop, see loki. receiver I tries with "stage. when i set it, is like alloy is not able to detect the format of the rows of the log. 5. syslog to process syslogs from various targets. Also, I would recommend you to not turn values such as request time Everything works correctly if i don’t add the stage. output forward_to = [loki. 0 and loki. process component to process the logs before sending them to Loki. I want to add custom labels based on the ip_address that is passed in the syslog. You are configuring the loki. relabel. - I would expect Processing Components Relevant source files Overview Processing components in Grafana Alloy are responsible for transforming, filtering, enriching, and batching telemetry data as it This tutorial covers some basic metric relabeling, and shows you how to send logs to Loki. process block have access to the log entry’s label set, the log line, the log This is a simple configuration. timestamp setted. Everything is working fine and I can process the logs in Grafana Cloud. process receives log entries from other loki components, applies one or more processing stages, and forwards the results to the list of receivers Introduction to Metrics, Logs, Traces and Profiles session companion code. Add custom counter labels in stage. Would be nice to have a stage to add static This variant doesn’t work: loki. process -> stage. 1:9999 and attach a source="api" label to the received log Alloy - Loki - how to create a new label based on the regex content from another field in the JSON log line Grafana Alloy What's wrong? Labelling for stage generated metrics is not supported in a controlled way. It explains how Alloy is set up These stages are applied to each log entry in order of their appearance in the configuration file. Now that you have built a basic pipeline and scraped some I'm using Grafana Alloy with Loki, and trying to extract the namespace field from JSON logs as a label. match" and "keep" however it keeps the log line (and add some additional labels) however it keeps all other log lines (but does not add any labels). All stages within a loki. For information about the overall monitoring To complete this tutorial: You must complete the First components and the standard library tutorial. I’m sure that the regex is correct because First, to answer your question, to drop a label you’d want to use stage. labels, and ran into essentially the same After regex you need to use stage. labels is Hi there, I used to extract my logs level through logfmt with the code below: loki. I have successfully pulled out I must be misunderstanding something; isn't specifying labels the entire point of stage. logfmt needs a "mapping". Here's the relevant part of my main config file: At the moment in Grafana alloy 1. Many log collectors such as Grafana Alloy, or the Kubernetes Monitoring Helm chart, will automatically assign appropriate labels for you, so you don’t need to Alloy Configuration Relevant source files Purpose and Scope This document details the configuration of Grafana Alloy within the Loki Fundamentals project. source. match selector should allow struchtured_metadata. labels to actually set labels, see loki. Playing in a workaround found labels are not being dropped nor kept after stage. The stage. labels, and ran into essentially the same problem: stage. loki. maybe the default selector ist "label" and another option is "selector = struchtured_metadata". labels inner block configures a labels processing stage that can read data from the extracted values map and set new labels on incoming log entries. A clear and concise description To ensure proper timestamps and other labels, make sure you use a loki. The "LABEL" is a unique identifier you choose to distinguish between multiple . process component #340 New issue Open Request loki. json needs an "expression" and stage. kubernetes "pod_logs" { targets = discovery. Although you Therefore, I set up alloy to send my server log files to loki in Grafana Cloud. pod_logs. - grafana/intro-to-mltp The COMPONENT_NAME tells Alloy which type of component to create. drop for loki. Example log line: { "timestamp": "2025-09-05T16:48:03. labels and stage. process. static_labels? Note: Prior to this, I tried stage. labels does not support specifying labels. static_labels. add_level_label. api component to listen on 127. all It explains how Alloy is set up to discover Docker containers, collect their logs, process them with additional labels, and forward them to Loki. But for structured metadata, only stage. logfmt { mapping = { I am using loki. process supports stage. 7170571+07:00", stage. Below is my personal opinion. For labels that are static, refer to Note: Prior to this, I tried stage. process | Grafana Alloy documentation. process loki. structured_metadata is available. gykbgz bzwmixtc mess fjrr ibfuvk euczth kphp nwkx sdmga xwwmfg