Skip to content

Issue with local.file_match and Nomad log rotation #3584

@thoward27

Description

@thoward27

What's wrong?

I'm trying to use Alloy to parse logs from Nomad allocations and forward them to Loki. Everything works at first, but then Alloy never picks up new log files as they are created.

Steps to reproduce

  1. Have a nomad client, running allocs.
  2. Deploy alloy with local.file_match to glob all of the log files
  3. Wait for a new log file to be created, alloy does not pull log lines from the new file

System information

Ubuntu 22.04.2 LTS (GNU/Linux 6.2.0-1015-aws x86_64)

Software version

version v1.8.2 (branch: HEAD, revision: 48d0d88)

Configuration

local.file_match "nomad_logs" {
  path_targets = [
    {__path__ = "/var/lib/nomad/alloc/*/alloc/logs/*.stdout.*", __path_exclude__="/var/lib/nomad/alloc/**/*.fifo"},
    {__path__ = "/var/lib/nomad/alloc/*/alloc/logs/*.stderr.*", __path_exclude__="/var/lib/nomad/alloc/**/*.fifo"},
  ]
}
loki.source.file "nomad_logs" {
  targets = local.file_match.nomad_logs.targets
  forward_to = [loki.write.loki_writer.receiver]
}

Logs

journalctl -u grafana-alloy -g "service-foo.stdout.65"
-- No entries --

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions