Answer the question
In order to leave comments, you need to log in
How to collect logs using Promtail?
Hello everyone, I'm trying to collect logs using promtail + loki + grafana.
The log file inside looks like:
{"asctime": "2022-02-15 13:19:1644931152", "levelname": "INFO", "module": "name_modul", "funcName": "info", "lineno": 18, "message": "messange for your informations"}
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: http://loki:3100/loki/api/v1/push
scrape_configs:
- job_name: incoming
pipeline_stages:
- json:
expressions:
messange: message
timestamp: asctime
funcName: funcName
- timestamp:
source: timestamp
- labels:
timestamp:
funcName:
- output:
source: message
static_configs:
- targets:
- localhost
labels:
job: logs
__path__: lib/docker/volumes/my_volume/_data/logfile.log
Unable to parse config: /etc/promtail/config.yml: yaml: line 16: found character that cannot start any token
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question