-
-
Notifications
You must be signed in to change notification settings - Fork 28
Example: Loki
Lorenzo Mangani edited this page Jul 26, 2021
·
17 revisions
paStash can be used to easily ship logs to Grafana Loki or cLoki
Install paStash next-gen and the Loki output plugin globally using npm:
# npm install -g @pastash/pastash @pastash/output_loki
In this super simple recipe we'll use the file input and loki output
input {
file {
path => "/var/log/*.log"
}
}
output {
loki {
host => localhost
port => 3100
path => "/loki/api/v1/push"
}
}
When using the Grafana Hosted Loki, use this format as template:
input {
file {
path => "/var/log/*.log"
}
}
output {
loki {
basic_auth_password => "some_very_secure_password_hash_here"
basic_auth_user => "1234"
host => "logs-us-west1.grafana.net"
port => 80
path => "/api/prom/push"
}
}
Once ready, save to your preferred location (ie: /etc/pastash_loki.json)
./bin/pastash --config_file=/etc/pastash_loki.json
For those using Docker there's a ready to go container for Loki output
pastash:
image: qxip/pastash-loki
container_name: pastash
volumes:
- ./conf/pastash_loki.json:/pastash.conf
- /var/log:/var/log:ro