static_configs: - targets: - localhost labels: job: syslog __path__: /var/log/syslog 这个配置将跟踪一个文件并分配一个标签:job=syslog。你可以这样查询: {job=”syslog”} 这将在 Loki 创建一个流。 现在让我们把这个例子扩大一点: scrape_configs: - job_name: system pipeline_stages: static_conf...
- url: http://10.20.20.20:3100/loki/api/v1/push scrape_configs: - job_name: loki static_configs: - targets: - localhost labels: job: syslog env: prod location: whcq vendor: loki hostname: m-loki __path__: /var/log/network/m-loki-127.0.0.1.log - job_name: syslog static_configs...
- url: http://loki:3100/loki/api/v1/push scrape_configs: - job_name: system static_configs: - targets: - localhost labels: job: varlogs __path__: /var/log/*log 这里的 job 就是 varlog,文件路径就是 /var/log/*log。 在grafana explore 上配置查看日志 查看日志 rate({job="message"}...
- url: http://loki:3100/loki/api/v1/push scrape_configs: - job_name: system static_configs: - targets: - localhost labels: job: varlogs __path__: /var/log/*log 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 这里的 job 就是 ...
static_configs: - targets: - localhost labels: job: varlogs __path__: /var/log/*log - job_name: system_new static_configs: - targets: - localhost labels: job: mysql46 __path__: /var/lib/mysql/*.err 1. 2. 3. 4. 5.
- job_name: xzyy#namespace名字static_configs: - targets: - node-111#node节点名字labels: job: varlogs#job名字,可以自定义__path__: /var/log/*.log#日志地址根据实际情况修改 注意:如果采用脚本程序运行 下载地址: https://github.com/grafana/loki/releases/download/v2.8.6/promtail-linux-amd64....
scrape_configs:- job_name: systempipeline_stages:static_configs:- targets:- localhostlabels:job: message__path__: /var/log/messages 上面这段配置代表启动一个日志采集任务 这个任务有 1 个固定标签job=”syslog” 采集日志路径为/var/log/messages,会以一个名为 filename 的固定标签 ...
static_configs: - targets: - localhost labels: job: cms-45 host: localhost __path__: /home/ccodrunner/Platform/log/cms2/cms2.log# UMG日志收集并打标签- job_name: UMG static_configs: - targets: - localhost labels: job: UMG-log
static_configs: - targets: - localhost labels: job: supervisor-logs __path__: /var/log/supervisor/*.log # 如下写法会收集该目录下所有子目录中所有的(类似filebeat 穿透子目录查找日志文件,并索引)递归查询 参考链接 https://github.com/bmatcuk/doublestar#patterns ...
static_configs: - targets: - localhost labels: job: alllog-next __path__: /data0/log-data/*/*/*/*/*/*.log - job_name: kubernetes-pods-name-msv-access # loki_push_api 将 Promtail 配置为公开 Loki 推送 API 服务器 # 注意:使用 loki_push_api 配置的每个 job 都将公开此 API,并且需...