Exclude file to import in grafana

Hello and sorry for my english,

i am new in Loki/grafana. I setup new configuration with rsyslog, promtail, loki and grafana.

I receive logs with rsyslog and after this logs are imported with promtail to loki. Logs are classified by folder with hostname.

Importation in grafana work but i ‘d like to exclude some log file to import and i don’t find the solution to do it in promtail… I want to exclude local logs of the server, this logs are locate : /mnt/v_srvlog/syslog/srvlog

my promtail conf :

server:
http_listen_port: 9080

positions:
filename: /tmp/positions.yaml

clients:

scrape_configs:

  • job_name: syslog
    static_configs:
    • targets:
      • localhost
        labels:
        job: syslog
        path: /mnt/v_srvlog/syslog//.log

i ‘d like to exclude all .log file that are in /mnt/v_srvlog/syslog/srvlog

thanks a lot

please i need help :slight_smile:

There should be a filename label, you can then match for that label for the path you don’t care about and drop the logs.