Hi everyone.
I’m trying to set my alloy agent to use a couple of pipelines to send logs to my LOKY in Grafana Cloud.
My first Pipeline (that collects logs from /var/log/*) works well but I can’t find the way to make the second pipeline work. This second pipeline should just collect logs from /log/milog.log, a simple file I’ve created)
This is my current config:
local.file_match “logs_default_varlogs” {
path_targets = [{
address = “localhost”,
path = “/var/log/*”,
instance = “ansible01”,
job = “varlogs”,
}]
}loki.source.file “logs_default_varlogs” {
targets = local.file_match.logs_default_varlogs.targets
forward_to = [loki.write.logs_default.receiver]
}loki.write “logs_default” {
endpoint {
url = “https://logs-prod-008.grafana.net/loki/api/v1/push”basic_auth { username = "123456" password = "mypassword" }
}
external_labels = {}
}local.file_match “tmplogs” {
path_targets = [{“path” = “/log/*”}]
}loki.source.file “local_files” {
targets = local.file_match.tmplogs.targets
forward_to = [loki.write.local_loki.receiver]
}loki.write “local_loki” {
endpoint {
url = “https://logs-prod-008.grafana.net/loki/api/v1/push”basic_auth { username = "123456" password = "mypassword" } } external_labels = {}
}
As I said the ‘logs_default_varlogs’ works well but my alloy is not collecting data from the /log/mylog.log file
I have make sure the file has read rights.
Any idea where can be the problem?
Thank you in advance and regards.