Hi,
i’m trying to monitor nextcloud log with Alloy and Loki and i’m facing issues. It seems that Alloy automatically add a “level” label that is always set to “info”, even if Nextcloud logs contains a “level” label set to “1”, or “2”, etc …
Here are 2 screenshots showing the output in grafana of the logs, focusing of a log with log level = 2.
The first one is without pipeing the ouput to JSON (the log level label is already here set to “info”), the second one is after pipeing the output to JSON (the level label didn’t changed).
Here is my alloy config
local.file_match "nextcloud_log" {
path_targets = [
{__path__ = "/var/log/nextcloud/{nextcloud,audit}.log",
job = "nextcloud_log",
sync_period = "5s"},
]
}
loki.source.file "nextcloud_log_scrape" {
targets = local.file_match.nextcloud_log.targets
forward_to = [loki.process.process_nextcloud_log.receiver]
}
// ==> I tried with and without this process stage without success
loki.process "process_nextcloud_log" {
forward_to = [loki.write.endpoint.receiver]
stage.label_drop {
values = ["level"]
}
}
loki.write "endpoint" {
endpoint {
url = "http://loki:3100/loki/api/v1/push"
}
}
Do you have any idea on what is going on? Thanks in advance !