Dynamic variables in LOKI configuration

Hello,

Is it possible to set in example, the hostname dynamically in the configuration? For example:

ams01-bhn-01:~ # cat /etc/loki/config-promtail.yml
server:
http_listen_port: 9080
grpc_listen_port: 0

positions:
filename: /tmp/positions.yaml

clients:

scrape_configs:

  • job_name: slurmdctl

    static_configs:

    • targets:
      • localhost
        labels:
        job: slurmctld
        host: %HOSTNAME%
        path: /var/log/slurmctld
2 Likes

please share the solution if you have got it