Repository navigation
|
Help me write a configuration for using vectors to ssh to the server and retrieve log files from the server.
|
Answered by
pront
Oct 29, 2026
Replies: 1 comment
|
You can run sources:
remote_logs:
type: exec
mode: streaming
include_stderr: false
command:
- ssh
- -o
- BatchMode=yes
- -o
- StrictHostKeyChecking=yes
- logs@example.com
- tail -n 0 -F /var/log/app.log
streaming:
respawn_on_exit: true
respawn_interval_secs: 5
sinks:
loki:
type: loki
inputs: [remote_logs]
endpoint: http://loki:3100
encoding:
codec: text
labels:
job: remote_appReplace the SSH destination, log path, and Loki endpoint. The account running Vector needs working SSH key authentication and a trusted host key in This tails new lines only. It does not keep file checkpoints, so lines written while disconnected can be missed when the command restarts. |
0 replies
Answer selected by
pront
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can run
sshthrough theexecsource and send its output to Loki:Replace the SSH destination, log path, and Loki endpoint. The account running Vector needs working SSH key authentication and a trusted host key in
k…