You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need to figure how to dynamically assign labels based on the filepath where logs are collected.
Logs will be collected from a bunch of subfolders under "logspath":
C:\folder01\logspath\customer01\app01\somelog.log
I have to assign a "customer" and a "app" label with the values extracted from the path.
This is done using Grafana Agent Flow (latest version).
is that the right flow ? (regex runs against the source_labels, selects the named group "customer" and that value "replaces" the target label "customer".) Or do I get all that wrong?
Even the regex is difficult to work with (works fine in regex101, but not in the agent config). Do you see what's wrong with it ?
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered:
Hello folks,
I need to figure how to dynamically assign labels based on the filepath where logs are collected.
Logs will be collected from a bunch of subfolders under "logspath":
C:\folder01\logspath\customer01\app01\somelog.log
I have to assign a "customer" and a "app" label with the values extracted from the path.
This is done using Grafana Agent Flow (latest version).
I found someone who was able to achieve that, but their config file syntax doesn't look at all like what I see in the documentation.
Your help would be greatly appreciated.
Code block I came up with (but doesn't work at all):
`loki.relabel "fixed_labels" {
forward_to = [loki.process.fields_to_label.receiver]
`
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: