Grafana Enterprise Logs Ingest logs using Promtail

Ingest logs using Promtail

Promtail is an agent that ships the contents of local logs to Grafana Enterprise Logs (GEL).

Verify that Promtail is running

Because there are several ways to Install Promtail, there are also several ways to verify that it is running. If you need help at all, submit a Support Enquiry.

For the following common installation methods, check that Promtail is running:

  • binary: To check that the executable is running, use ps -ef | grep promtail.
  • Docker: To check if a Promtail container is running, run docker ps.
  • Kubernetes: To check that Promtail pods are running, use the kubectl get pods | grep promtail command when you are in the correct namespace.

Configure Promtail to write to GEL

To configure Promtail to send logs to the demo tenant, add a clients block to its configuration.

Example of a minimal configuration:

  http_listen_port: 9080
  grpc_listen_port: 0

  filename: /tmp/positions.yaml

  - url: http://enterprise-logs:3100/loki/api/v1/push
      username: demo
      password: <token>

- job_name: system
  - targets:
      - localhost
      job: varlogs
      __path__: /var/log/*log

For more information, refer to Configuring Promtail.

Run this Promtail configuration using Docker

To run this configuration, store the preceding configuration locally in the file promtail.yaml, and run the following code:

$ docker run \
   -d \
   --name=demo-promtail \
   --network=enterprise-logs \
   -v $(pwd)/promtail.yaml:/etc/promtail/config.yml:z \

Verify that Promtail is writing to GEL

From Grafana Explore, you can query the data from your GEL cluster via the Enterprise Logs data source.