Hi,
After some time, and several changes I see that new entries are coming in [IN] to Alloy GUI for Live debugging, however in the same view I do not see any [OUT] to Grafana Loki. I tried to remove positions.yaml file to clean the offset, restart alloy service etc.
Is it something wrong with my config?
loki.write “grafana_loki” {
endpoint {
url = “”
}
}
local.file_match “coin” {
path_targets = [
{
“path” = “/usr/logs/report/*”,
“job” = “coin”,
},
]
sync_period = “5s”
}
loki.source.file “log_scrape” {
targets = local.file_match.coin.targets
forward_to = [loki.process.filter_logs.receiver]
}
loki.process “filter_logs” {
forward_to = [loki.write.grafana_loki.receiver]
stage.multiline {
firstline = ^Traceback \(most recent call last\):
max_wait_time = “3s”
}
stage.regex {
expression = “(?i)(?PERROR|WARN|INFO)\s+(?P[a-zA-Z0-9_.]+)”
}
stage.match {
selector = “{level!="ERROR"}”
action = “drop”
}
stage.regex {
source = “filename”
expression = “(?P/usr/.+/)(?P[^/]+)$”
}
stage.labels {
values = {
level = “level”,
module = “module”,
filename = “filename”,
path = “path”,
}
}
stage.limit {
rate = 10
burst = 50
}
}
logging {
level = “debug”
}
Now I’ve been thinking, even if I restart the Alloy service in a loop and delete the positions.yaml file beforehand, maybe it’s not reading new data to Loki because it already did that? No, no, but that’s exactly why I delete that positions.yaml file - so it starts reading from the beginning, so I don’t understand - [IN] is visible, [OUT] is not visible, Loki is empty, but Alloy is receiving. I would just like to test this now, I even created a dummy.log file and injected a short ERROR there for it to catch, and I can see this error in the Alloy GUI, but not in Loki anymore.