https://www.cnblogs.com/fengjian2016/p/13356125.html
https://www.bboy.app/2020/07/08/%E4%BD%BF%E7%94%A8loki%E8%BF%9B%E8%A1%8C%E6%97%A5%E5%BF%97%E6%94%B6%E9%9B%86/
tomcat多行日志合并
https://www.ngui.cc/51cto/show-602779.html
https://grafana.com/docs/loki/latest/clients/promtail/stages/regex/
[root@tomcat01 promtail]# cat config.yaml
## https://www.cnblogs.com/fsckzy/p/13231696.html
# Promtail Server Config
server:
http_listen_port: 9080
grpc_listen_port: 0
# Positions
positions:
filename: /tmp/positions.yaml
# Loki服务器的地址
clients:
- url: http://192.168.130.155:3100/loki/api/v1/push
scrape_configs:
- job_name: xxx-tomcat
static_configs:
- targets:
- tomcat
labels:
job: xxx-wx-msg
host: xxx-tomcat01
filename: wx-msg.log
__path__: /xxx/wx-msg/wx-msg.log
pipeline_stages:
- match:
selector: '{host="xxx-tomcat01"}'
stages:
# https://grafana.com/docs/loki/latest/clients/promtail/stages/regex/
- regex:
expression: '.*'
multiline:
firstline: '^202'