之前把loki升到 3.7的時候
有發現怎麼少了很多檔案
因為都會同時升級 promtail
昨天看文件才發現 EOL了
雖然還是可以用 但總是要找別的解決方案
找到了 vector
滿多人推的
官網有rpm但可以不用裝rpm
直接下載執行檔來執行就好了
vector config 根据原來的promtail 調整如下
# 1. 定義資料來源 (對應 Promtail 的 scrape_configs)
sources:
forti_logs:
type: "file"
include:
- "/var/log/messages"
# 對應 Promtail 的 positions.filename
data_dir: "/vector_data"
# 2. 處理資料與添加標籤 (對應 Promtail 的 labels)
transforms:
add_labels:
type: "remap"
inputs:
- "forti_logs"
source: |
.job = "forti_auth"
.host = get_hostname!()
# 3. 定義目的地 (對應 Promtail 的 clients.url)
sinks:
loki_output:
type: "loki"
inputs:
- "add_labels"
endpoint: "http://10.10.0.10:3100"
encoding:
codec: "text"
labels:
job: "{{ job }}"
host: "{{ host }}"
grafana官網是建議使用 alloy
但測了一下一直有問題
沒有留言:
張貼留言