Promtail: Multiple job_name

Hi, I would like to check if Promtail supports multiple jobs under one scrape_config. The reason why I am asking this is because I require a different set of pipelines for both jobs. Below is a snippet of my current promtail-config.yaml.

scrape_configs:
  - job_name: Test1
    pipeline_stages:
    - timestamp:
        source: $tsNs
        format: UnixNs
    static_configs:
    - targets:
        - localhost
      labels:
        job: Test1
        __path__: /var/log/*log


  - job_name: Test2
    - targets:
        - localhost
      labels:
        job: Test2
        __path__: /path/to/test.txt

However, when I run this, it throws an error at the second job_name line stating “did not find expected key”. Is this because of a yaml syntax error, or does Promtail not support this use case?

Please let me know if additional information is required!

HI I just resolved by adding like below
server:
http_listen_port: 9080
grpc_listen_port: 0

positions:
filename: /tmp/positions.yaml

clients:

scrape_configs:

  • job_name: grafana
    static_configs:
    • targets:
      • localhost
        labels:
        job: varlogs
        path: “C:/Temenos/log/*.log”
    • targets:
      • localhost
        labels:
        job: varlogs1
        path: “C:/Temenos/TAFJ/log/*.log”
1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.