I have this example logline from haproxy:
Sep 5 09:02:00 proxy01 haproxy[10460]: 127.0.0.1:40882 [05/Sep/2025:09:02:00.812] http-in http-pool 0/0/17/25/42 200 672 - - ---- 500/402/225/217/0 0/0 {xx.xx.xx.xx|} “GET /path/to/427572 HTTP/1.1”
My config.alloy is like this:
livedebugging {
enabled = true
}logging {
level = “debug”
format = “json”
}local.file_match “lb_haproxy_logs” {
path_targets = [{
// “_path_” = “/var/log/haproxy.log”,
“_path_” = “/path/to/haproxy_test.log”,
“job” = “lb_haproxy_logs”,
“hostname” = env(“HOSTNAME”),
}]
sync_period = “5s”
}loki.source.file “lb_haproxy_logs” {
targets = local.file_match.lb_haproxy_logs.targets
forward_to = [loki.process.lb_haproxy_logs.receiver]
tail_from_end = false
}loki.process “lb_haproxy_logs” {
stage.regex {
expression =^(?P<timestamp>[\d\-T\:\.]+-[\d\:\+]+)\s+(?P<hostname>[\w\-\d]+)\s+(?P<process>[\w\-\d]+)\[(?P<pid>\d+)\]:\s+(?P<client_ip>[\d\.]+):(?P<client_port>\d+)\s+\[(?P<request_time>[^\]]+)\]\s+(?P<frontend>[\w\-~]+)\s+(?P<backend>[\w\-\/]+)\s+(?P<timing>(?:-?\d+\/)+-?\d+)\s+(?P<status_code>-?\d+)\s+(?P<response_size>\d+)\s+(?P<unknown1>[-\w]*)\s+(?P<unknown2>[-\w]*)\s+(?P<tcp_flags>[\w\-]+)\s+(?P<connection_info>[\d\/]+)\s+(?P<queue_info>[\d\/]+)\s+{(?P<host_url>[^}]+)}\s+"(?P<http_method>\w+)\s+(?P<url>[^\s]+)\s+(?P<http_version>HTTP\/[\d\.]+)"
}stage.labels {
values = {
timestamp = “”,
hostname = “”,
process = “”,
pid = “”,
client_ip = “”,
client_port = “”,
frontend = “”,
backend = “”,
status_code = “”,
http_method = “”,
url = “”,
http_version = “”,
}
}forward_to = [loki.echo.lb_haproxy_logs.receiver]
}loki.echo “lb_haproxy_logs” {}
But i didn’t see the result in the output of loki.echo:
{“ts”:“2025-09-05T13:37:57.305978929Z”,“level”:“info”,“msg”:“Successfully reopened truncated /path/to/haproxy_test.log”,“component_path”:“/”,“component_id”:“loki.source.file.lb_haproxy_logs”,“component”:“tailer”}
{“ts”:“2025-09-05T13:37:57.306357744Z”,“level”:“info”,“component_path”:“/”,“component_id”:“loki.echo.lb_haproxy_logs”,“receiver”:“loki.echo.lb_haproxy_logs”,“entry”:“Sep 5 09:02:00 proxy01 haproxy[10460]: 127.0.0.1:40882 [05/Sep/2025:09:02:00.812] http-in http-pool 0/0/17/25/42 200 672 - - ---- 500/402/225/217/0 0/0 {xx.xx.xx.xx|} “GET /path/to/427572 HTTP/1.1””,“entry_timestamp”:“2025-09-05T15:37:57.306031368+02:00”,“labels”:“{filename=“/path/to/haproxy_test.log”, job=“lb_haproxy_logs”}”,“structured_metadata”:“{}”}
{“ts”:“2025-09-05T13:47:57.055404217Z”,“level”:“debug”,“msg”:“labelstore removing stale markers”}
{“ts”:“2025-09-05T13:47:57.05547948Z”,“level”:“debug”,“msg”:“number of ids to remove”,“count”:0}
What do i wrong in alloy configuration?

