Getting Victoria Logs running on FreeBSD

This post is only about getting Victoria Logs running on FreeBSD. A future post will go over configuration and getting logs in. I’m hoping Victoria Logs can fill the role which ElasticSearch once tried to fill, but failed; it was too finicky and fragile for my use.

In this post:

  • FreeBSD 15.0
  • victoria-logs-1.50.0_2
  • mkjail-0.0.8

Jail creation

I’m going to run this in a jail, like most things. You don’t have to. I’m using sysutils/mkjail for this.

[19:08 r730-01 dvl ~] % sudo mkjail create -a amd64 -v 15.0-RELEASE -j logs
Creating data02/jails/logs...
Extracting base into /jails/logs...
Extracting lib32 into /jails/logs...
Copying in default flavor...
Updating logs jail...

src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 3 mirrors found.
Fetching metadata signature for 15.0-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Inspecting system... done.
Preparing to download files... done.
The following files will be removed as part of updating to
...
/usr/share/zoneinfo/Europe/Tiraspol
/usr/share/zoneinfo/Mexico/BajaNorte
/usr/share/zoneinfo/tzdata.zi
/usr/share/zoneinfo/zone.tab
/usr/share/zoneinfo/zone1970.tab
Installing updates... done.

Now put something like the following in /etc/jail.conf:

exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown jail";
exec.clean;
mount.devfs;
path = /jails/$name;
securelevel = 2;

logs {
    host.hostname = "logs";
    ip4.addr = 127.1.0.201;
    ip6.addr = 2001:0db8::141;
    persist;
}

and then you can start the jail like so:

# service jail start logs

That’s not the jail configuration I used. I used this:

[19:57 r730-01 dvl /usr/local/etc/jail.conf.d] % cat logs.conf 
logs {


    ip4.addr = "$bridge|10.55.0.18";
}

Separate file system

I created a separate file system for Victoria Logs. Because I can. You don’t have to. However, this will let me snapshot, backup, etc.

I discovered the directory name in the rc.d script (/usr/local/etc/rc.d/victoria_logs).

[19:40 r730-01 dvl /usr/local/etc/jail.conf.d] % sudo zfs create -o mountpoint=/jails/logs/var/db/victoria-logs -o recordsize=128K -o compression=zstd data04/victoria-logs
[19:42 r730-01 dvl /usr/local/etc/jail.conf.d] % 
[19:42 r730-01 dvl /usr/local/etc/jail.conf.d] % ls -ld /jails/logs/var/db/victoria-logs
drwxr-xr-x  2 root wheel 2 2026.06.14 19:42 /jails/logs/var/db/victoria-logs/

And here it is from within the jail:

[19:47 logs dvl ~] % ls  -ld /var/db/victoria-logs
drwxr-xr-x  2 root wheel 2 2026.06.14 19:42 /var/db/victoria-logs/

Looking in /usr/local/etc/rc.d/victoria_logs, I see we have a user and a group defined. Let’s adjust the permissions on that directory:

[19:47 logs dvl ~] % sudo chown victoria-logs:victoria-logs /var/db/victoria-logs
[19:48 logs dvl ~] % id victoria-logs                                                       
uid=363(victoria-logs) gid=363(victoria-logs) groups=363(victoria-logs)
[19:48 logs dvl ~] % ls -ld /var/db/victoria-logs                                          
drwxr-xr-x  2 victoria-logs victoria-logs 2 2026.06.14 19:42 /var/db/victoria-logs/
[19:48 logs dvl ~] % 

Enable, and start:

[19:38 logs dvl ~] % sudo sysrc victoria_logs_enable="YES"       
victoria_logs_enable:  -> YES
[19:48 logs dvl ~] % sudo service victoria_logs start 
Starting victoria_logs.
[19:49 logs dvl ~] % ps auwwxd | grep victoria                                              
dvl           96808  0.0  0.0   14164  2680  4  S+J  19:50   0:00.00     `-- grep victoria
victoria-logs 92857  0.0  0.0   14184  2556  -  SsJ  19:49   0:00.00 daemon: victoria_logs[92858] (daemon)
victoria-logs 92858  0.0  0.0 1274348 14292  -  SJ   19:49   0:00.05 - /usr/local/bin/victoria-logs -storageDataPath=/var/db/victoria-logs -retentionPeriod=1 -httpListenAddr=:9428
[19:50 logs dvl ~] % ls -l /var/db/victoria-logs 
total 1
-rw-r--r--  1 victoria-logs victoria-logs 0 2026.06.14 19:49 flock.lock
drwxr-xr-x  2 victoria-logs victoria-logs 2 2026.06.14 19:49 partitions/
[19:50 logs dvl ~] % ls -l /var/db/victoria-logs/partitions 
total 0

Where is it listening?

[20:06 logs dvl ~] % sockstat -4 | grep vict
victoria-logs victoria-l 92858  5 tcp4  10.55.0.18:9428       *:*                  

The logs

The app logs are over here:

[20:07 logs dvl ~] % sudo ls -l /var/log/victoria_logs
total 9
-rw-------  1 victoria-logs victoria-logs 1663 Jun 14 19:49 victoria_logs.log
[20:07 logs dvl ~] % sudo tail /var/log/victoria_log/victoria_logs.log
tail: /var/log/victoria_log/victoria_logs.log: No such file or directory
[20:07 logs dvl ~] % sudo tail /var/log/victoria_logs/victoria_logs.log
2026-06-14T19:49:51.937Z	info	VictoriaMetrics/lib/logger/flag.go:13	command-line flags
2026-06-14T19:49:51.937Z	info	VictoriaMetrics/lib/logger/flag.go:20	  -httpListenAddr=":9428"
2026-06-14T19:49:51.937Z	info	VictoriaMetrics/lib/logger/flag.go:20	  -retentionPeriod="1"
2026-06-14T19:49:51.937Z	info	VictoriaMetrics/lib/logger/flag.go:20	  -storageDataPath="/var/db/victoria-logs"
2026-06-14T19:49:51.938Z	info	/wrkdirs/usr/ports/net-mgmt/victoria-logs/work/VictoriaLogs-1.50.0/app/victoria-logs/main.go:43	starting VictoriaLogs at "[:9428]"...
2026-06-14T19:49:51.938Z	info	/wrkdirs/usr/ports/net-mgmt/victoria-logs/work/VictoriaLogs-1.50.0/app/vlstorage/main.go:145	opening storage at -storageDataPath=/var/db/victoria-logs
2026-06-14T19:49:52.007Z	info	/wrkdirs/usr/ports/net-mgmt/victoria-logs/work/VictoriaLogs-1.50.0/app/vlstorage/main.go:151	successfully opened storage in 0.069 seconds; smallParts: 0; bigParts: 0; smallPartBlocks: 0; bigPartBlocks: 0; smallPartRows: 0; bigPartRows: 0; smallPartSize: 0 bytes; bigPartSize: 0 bytes
2026-06-14T19:49:52.008Z	info	/wrkdirs/usr/ports/net-mgmt/victoria-logs/work/VictoriaLogs-1.50.0/app/victoria-logs/main.go:55	started VictoriaLogs in 0.070 seconds; see https://docs.victoriametrics.com/victorialogs/
2026-06-14T19:49:52.009Z	info	VictoriaMetrics/lib/httpserver/httpserver.go:146	started server at http://10.55.0.18:9428/
2026-06-14T19:49:52.009Z	info	VictoriaMetrics/lib/httpserver/httpserver.go:148	pprof handlers are exposed at http://10.55.0.18:9428/debug/pprof/
[20:08 logs dvl ~] % 

This seems ready to go.

I’ll push this to the website and get on with the next post covering configuration and pushing logs into the tool.

Website Pin Facebook Twitter Myspace Friendfeed Technorati del.icio.us Digg Google StumbleUpon Premium Responsive

Leave a Comment

Scroll to Top