Hey,
I am having Problems figuring out how to use a windows Environment Variable created by an Applikation in the Path. I want to use it as Part of the Path because the app name can be different. This is the iteration where the app at least starts but doesn’t find anything.
appPath = C:\Program Files\app
local.file_match “app” {
path_targets = [
{path = “sys.env(appPath)\logs\*.log”},
** {path = “sys.env(appPath)\lib\version*.txt”},**
** {path = “sys.env(appPath)\webserver\standalone\log\*.log”},**
]
}
loki.source.file “app” {
targets = local.file_match.app.targets
forward_to = [loki.write.app.receiver]
}
loki.write “app” {
endpoint {
url = “https://loki.url”
}
}
PS:
If you label here you get the same log for every file can you get different Labels for each discovered file?
local.file_match “app” {
path_targets = [
{path = “sys.env(appPath)\logs\.log", app = “log”},
{path = "sys.env(appPath)\lib\version.txt”},
{path = “sys.env(appPath)\webserver\standalone\log\*.log”},
]
}