Skip to content
Discussion options

You must be logged in to vote

You can run ssh through the exec source and send its output to Loki:

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_app

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…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pront
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
sink:loki Anything `loki` sink related source:exec Anything `exec` source related
2 participants
Converted from issue

This discussion was converted from issue #19171 on November 16, 2023 15:54.