PhoenixBlue
PhoenixBlue

Reputation: 1037

filter filenames in logql (grafana), extracted from multiple subfolders

I am building a dashboard in grafana, and previously, my queries to get the logs were:

{filename=~"/var/logs/tfc/local/reportserver+.+"}

This was to get all rotated files from the reportserver logs. Now there may be other servers sending their logs into /var/logs/tfc/ but in different subfolders. So I tried this new filter, to get all reportserver logs from all subdirectories:

{filename=~"/var/logs/tfc/**/reportserver+.+"} But this is not working. How can I modi fy the query to get the result I want?

Upvotes: 1

Views: 485

Answers (1)

markalex
markalex

Reputation: 13432

Regex selector =~ uses regexes, but you have some strange mix of regex and ant-style globs.

Based on your description I believe you need this query:

{filename=~"/var/logs/tfc/.+/reportserver.+"}

Upvotes: 0

Related Questions