Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a prefix to logs/jobs #224

Open
DST73 opened this issue May 18, 2024 · 1 comment
Open

Add a prefix to logs/jobs #224

DST73 opened this issue May 18, 2024 · 1 comment

Comments

@DST73
Copy link

DST73 commented May 18, 2024

Is your feature request related to a problem? Please describe.
My problem is, that I have two HA server logging to the same loki docker instance.
My problem is, that I now can’t distinguish from witch HA the messages are coming from.
Is there a way to add a prefix or something that I can use to filter?

Describe the solution you'd like
A way to add a prefix to the log or job or something I can filter for within grafana

Thank you!

@Bierchermuesli
Copy link

override the default scrape config (additional_scrape_configs and skip_default_scrape_config like so?


  - job_name: journal
    journal:
      json: false
      max_age: 12h
      labels:
        job: systemd-journal
        instance: whateveryourhostnameis.com
      path: "${JOURNAL_PATH}"
    relabel_configs:
      - source_labels:
          - __journal__systemd_unit
        target_label: unit
      - source_labels:
          - __journal__hostname
        target_label: nodename
      - source_labels:
          - __journal_syslog_identifier
        target_label: syslog_identifier
      - source_labels:
          - __journal_container_name
        target_label: container_name
    pipeline_stages:
      - match:
          selector: '{container_name=~"homeassistant|hassio_supervisor"}'
          stages:
            - multiline:
                firstline: '^\x{001b}'

basically just add a instance label?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants