Skip to content

Example: Loki

Lorenzo Mangani edited this page Jan 9, 2019 · 17 revisions

Loki Logging

paStash can be used to easily ship logs to Grafana Loki or cLoki

Setup

Install paStash next-gen and the Loki output plugin globally using npm:

# npm install -g @pastash/pastash @pastash/output_loki

Recipe

In this super simple recipe we'll use the file input and loki output & save (path/to/pastash_loki.json)

input {
  file {
    path => "/var/log/*.log"
  }
}

output {
  loki {
    host => localhost
    port => 3100
    path => "/api/prom/push"
  }
}

Usage

./bin/pastash --config_file=/path/to/pastash_loki.json

Docker

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
Clone this wiki locally