Monitoring Logs Of A New System
This page shows you how to scrap logs and push them to our ingestor
The provided script automates the deployment and configuration of the Promtail agent, which is used for log aggregation and forwarding to a Loki deployment. Here's a brief summary of how to use the script:
Review, download and run the promtail agent installer script:
Add execute permissions and run the script:
System Update: The script begins with a system update, running:
apt update
andapt dist-upgrade
to ensure the system is up to date.Promtail Installation: The script then downloads the Promtail binary from the official Grafana Loki repository, extracts it, and moves it to
/usr/local/bin/
. It also verifies the version of Promtail.Configuration: The script creates the necessary directories for Promtail's configuration and data files (
/etc/promtail
and/data/promtail
). It then adds a default configuration file (config.yaml
) for Promtail, which you need to edit with your specific settings.Systemd Service: The script sets up a systemd service file for Promtail (
/etc/systemd/system/promtail.service
) to enable automatic start and management of the Promtail agent as a service.Configuration Reminder: The script reminds you to edit the
/etc/promtail/config.yaml
file with your specific configuration details before starting the Promtail agent.Starting and Checking Service: The script provides instructions for starting the Promtail agent using
sudo systemctl start promtail.service
and checking the service's status withsystemctl status promtail.service
.
Remember to review and update the configuration files with your desired settings to ensure Promtail is properly configured for your environment.
Last updated