I am setting up a file match for a group of log files that follow a naming pattern like DA$SOMENAME250318.log. I am attempting to use wildcards for the $ and Date. As is, I get no error, but I also get no logs sent to Loki. I set up a Loki.source.file component and explicitly listed the entire file name without wild cards to forward to an echo component for debugging and that produced logs.
Here is the current config section:
local.file_match "service_logs" {
path_targets = [{"__path__" = "D:/SomeProject/SomeService/Bin/Log/DA$SOMENAME*.log"}]
sync_period = "5s"
}
loki.source.file "service_scrape" {
targets = local.file_match.service_logs.targets
forward_to = [loki.process.service_labels.receiver]
tail_from_end = true
}
I also tried
local.file_match "service_logs" {
path_targets = [{"__path__" = "D:/SomeProject/SomeService/Bin/Log/DA?SOMENAME*.log"}]
sync_period = "5s"
}
I receive the following log in EventViewer:
“msg=“no files targets were passed, nothing will be tailed” component_path=/ component_id=loki.source.file.service_scrape”.