Skip to content

Victoria Logs

Victoria Logs is a high-performance log management system.

Installation as a service

There are many ways for installing Victoria Logs. Normally, for a Linux environment, you may want to install it as a service. Based on how VictoriaMetrics is deployed as binary, we have come up with this guide:

Download

Set version, architecture and OS:

# Check for latest release of Victoria Logs
VICTORIALOGS_VERSION=$(curl --silent "https://api.github.com/repos/VictoriaMetrics/VictoriaLogs/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
# Choose your architecture
# amd64 arm64 386
VICTORIALOGS_ARCH=amd64
# Choose your S.O.
# darwin freebsd linux openbsd windows
VICTORIALOGS_SO=linux

Download binary:

curl -L -O https://github.com/VictoriaMetrics/VictoriaLogs/releases/download/$VICTORIALOGS_VERSION/victoria-logs-$VICTORIALOGS_SO-$VICTORIALOGS_ARCH-$VICTORIALOGS_VERSION.tar.gz
tar xzf victoria-logs-$VICTORIALOGS_SO-$VICTORIALOGS_ARCH-$VICTORIALOGS_VERSION.tar.gz

UPGRADES

ℹ️ Repeat this step for upgrading Victoria Logs version

Install

Move binary to /usr/local/bin:

sudo mv victoria-logs-prod /usr/local/bin

UPGRADES

ℹ️ Repeat this step for upgrading Victoria Logs version

System Setup

Create VictoriaLogs user

sudo useradd -s /usr/sbin/nologin victoria

Change ownership

sudo chown victoria:victoria /usr/local/bin/victoria-logs-prod

UPGRADES

ℹ️ Repeat this step for upgrading Victoria Logs version

SELlinux permission

In case you run SELlinux, change SELlinux permission:

sudo restorecon -v /usr/local/bin/victoria-logs-prod

UPGRADES

ℹ️ Repeat this step for upgrading Victoria Logs version

Create VictoriaLogs data directory

sudo mkdir -p /var/lib/victoria-logs-data && sudo chown -R victoria:victoria /var/lib/victoria-logs-data

Service Configuration

Create victorialogs service:

sudo vim /etc/systemd/system/victorialogs.service

The file should look like:

[Unit]
Description=VictoriaLogs service
#After=network.target
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=victoria
Group=victoria

EnvironmentFile=-/etc/default/victorialogs

ExecStart=/usr/local/bin/victoria-logs-prod \
-envflag.enable
SyslogIdentifier=victorialogs
Restart=always

PrivateTmp=yes
#ProtectHome=yes
NoNewPrivileges=yes

ProtectSystem=full

[Install]
WantedBy=multi-user.target

Create /etc/default/victorialogs file:

sudo vim /etc/default/victorialogs

Add the following content:

storageDataPath=/var/lib/victoria-logs-data
search_maxQueryDuration=600s
search_maxQueueDuration=600s
retentionPeriod=365d
retention_maxDiskUsagePercent=80
#-retention.maxDiskSpaceUsageBytes=800GiB

Retention Configuration

Note that -retention* parameters control lifecycle of ingested logs:

-retentionPeriod=365d
-retention.maxDiskUsagePercent=80
#-retention.maxDiskSpaceUsageBytes=800GiB

Adjust these values based on your storage capacity and retention requirements.

Important

⚔️ -retention.maxDiskSpaceUsageBytes and -retention.maxDiskUsagePercent flags are mutually exclusive.

VictoriaLogs will refuse to start if both flags are set simultaneously.

Query Configuration

Note that -search* parameters control query execution timeouts:

-search.maxQueryDuration=600s 
-search.maxQueueDuration=600s

600s = 10 minutes

This is a very long value, useful for running queries over large datasets. Adjust these values based on your query requirements.

See full options for Victoria Logs flags

Start Service

Start and enable the service:

sudo systemctl daemon-reload
sudo systemctl enable victorialogs
sudo systemctl start victorialogs
sudo systemctl status victorialogs

Troubleshooting

Check version:

victoria-logs-prod --version

Check service status:

sudo systemctl status victorialogs

Check logs:

sudo journalctl -u victorialogs -f

Refer to the Victoria Logs documentation for detailed configuration options.

Next Steps

Once Victoria Logs is configured:

  1. Import dashboards in Grafana

  2. Start dancing with your logs!

Extra Bonus

Consider deploying Victoria Logs MCP server 😱🤖✨