Relabel per subdirectory

I have set up Promtail to scrape logs from the inux host and also some log files. On that host there are several instances of a service running and they all produce logs in the folder /logs. The logs are separated into subdirectories, so the actual log files would have the paths /logs/instance1/somelog.log, /logs/instance2/somelog.log and so on. Is there a way to tell promtail to relabel according to instance name, which in this case is the name of the subdirectory? So I can filter the logs for a specific instance only.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.