-
What Grafana version and what operating system are you using?
Grafana v9.1.4 -
What are you trying to achieve?
I’m collecting metrics about log files with filestat_exporter, and i would like to have graphic with the count of rotated logs per day based on values of the label path.
file_stat_size_bytes{fqdn=~“$fqdn”,path=~“/var/log/mylog-[0-9].*.log”}
so the path label has values like this:
/var/log/mylog-2023-03-18.0.log
/var/log/mylog-2023-03-18.1.log
/var/log/mylog-2023-03-18.2.log
/var/log/mylog-2023-03-18.3.log
/var/log/mylog-2023-03-19.0.log
/var/log/mylog-2023-03-19.1.log
/var/log/mylog-2023-03-19.2.log
How can i write a PromQL that would give me a bar graphic with the count of rotated logs per day based on the values of the label path?
Using the values above, the end result would be:
2023-03-18 → 4
2023-03-19 → 3