Skip to content

Instantly share code, notes, and snippets.

@josephwoodward
Last active August 24, 2022 14:52
Show Gist options
  • Save josephwoodward/d73ad800627b7697c37a3c8908b572c6 to your computer and use it in GitHub Desktop.
Save josephwoodward/d73ad800627b7697c37a3c8908b572c6 to your computer and use it in GitHub Desktop.

Getting the following error when running promtrail:

./promtail_darwin_amd64 -config.file=promtail.yml

level=error ts=2019-10-09T20:07:54.577597Z caller=main.go:51 msg="error creating promtail" error="failed to make file target manager: invalid json stage config: JMES expression is required"

My log file:

{"@t":"2019-10-09T17:59:46.4148580Z","@mt":"Hello, world!","@l":"Debug"}

Promtrail.yml

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /tmp/positions.yaml

clients:
  - url: http://localhost:3100/api/prom/push

scrape_configs:
  - job_name: system
    static_configs:
      - targets:
          - localhost
        labels:
          __path__: /logs/loki/*.json
    pipeline_stages:
      - json:
          timestamp:
            source: '"@t"'
            format: RFC3339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment