How to add variable hostname label to static_config in Promtail?

How do I get the hostname added as a label when using “static_config”? I have tried starting promtail with --client.external-labels=hostname=$(hostname) but I couldn’t get that to work. Can anyone post their config?

scrape_configs:
  - job_name: app_log
    static_configs:
      - targets:
          - localhost
        labels:
          job: syslog
          __path__: /var/log/app.log
          hostname: ???
promtail, version 2.5.0 (branch: HEAD, revision: 2d9d0ee23)
  build user:       root@4779f4b48f3a
  build date:       2022-04-07T21:50:00Z
  go version:       go1.17.6
  platform:         linux/amd64