Alex_Geer
@Alex_Geer
System Engineer

Что не так в конфиге?

Всем привет. Пытаюсь освоить promtail сделал не большой конфиг для теста, но выдает ошибку: line 15: field unit not found in type scrapeconfig.JournalTargetConfig.
Подскажите пожалуйста где я ошибку сделал.

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /tmp/positions.yaml

clients:
  - url: http://192.168.100.9:3100/loki/api/v1/push

scrape_configs:
  - job_name: 'game.service'
    journal:
      max_age: 12h
      unit: 'game.service'
    pipeline_stages:
      - regex:
          expressions:
            date_time: '\b(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{1,2}\s\d{2}:\d{2}:\d{2}'
            ip_address: '\b(?:\d{1,3}\.){3}\d{1,3}\b'
            host_pid: '[a-zA-Z0-9_/-]+\[\d+\]'
            log_level: '\b(?:INFO|DEBUG|WARNING|ERROR)\b'
            message: '(?<=\]\s).+$'
  • Вопрос задан
  • 138 просмотров
Пригласить эксперта
Ответы на вопрос 1
@Zerg89
unit: 'game.service'
Нету директивы unit
# When true, log messages from the journal are passed through the
# pipeline as a JSON message with all of the journal entries' original
# fields. When false, the log message is the text content of the MESSAGE
# field from the journal entry.
[json: | default = false]

# The oldest relative time from process start that will be read
# and sent to Loki.
[max_age: | default = 7h]

# Label map to add to every log coming out of the journal
labels:
[ : ... ]

# Path to a directory to read entries from. Defaults to system
# paths (/var/log/journal and /run/log/journal) when empty.
[path: ]
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы