suricatavel-agent
suricatavel-agent is an agent that reads the eve.json files generated by Suricata and publishes events to Kafka or HTTP with a reliable approach.
Key features
Section titled “Key features”- Continuous reading of
eve.json. - Adaptive batching of events for efficiency and latency control.
- Local buffer and retries: when transport is unavailable, events are stored in
/var/lib/suricatavel-agent/app/suricatavel-agent.sqliteand resent with exponential backoff. - Persistent Dead Letter Queue (DLQ) for messages exceeding max attempts.
- Periodic heartbeats to indicate status (
running,starting,error,shutdown). - Support for SASL/SSL (Kafka) with configurable certificates and credentials.
Requirements
Section titled “Requirements”- Access to Suricata’s
eve.jsonfile(s). - PHP 8.5 with
rdkafkaextension, if using Kafka.
Installation
Section titled “Installation”1. Configure repository
Section titled “1. Configure repository”Execute the following commands to add the GPG key and repository source.
# 1. Install prerequisitessudo apt-get updatesudo apt-get install -y ca-certificates curl gpg
# 2. Add GPG keysudo mkdir -p /etc/apt/keyringscurl -fsSL https://repository.suricatavel.org/pubkey.gpg | \ sudo gpg --dearmor -o /etc/apt/keyrings/suricatavel.gpg
# 3. Add repository source (.sources)sudo tee /etc/apt/sources.list.d/suricatavel.sources << 'EOF'Types: debURIs: https://repository.suricatavel.org/Suites: stableComponents: suricatavel-agentSigned-By: /etc/apt/keyrings/suricatavel.gpgEOF
# 4. Update indexsudo apt-get updateEnable EPEL and CodeReady Builder, and Remi for PHP, then add the repository. The minimal images bring curl-minimal, which conflicts with the curl package: there is no need to install it.
# 1. Enable EPEL and CodeReady Builder (as your distribution does it), then Remi for PHP 8.5# Rocky / AlmaLinux:# dnf install -y epel-release && dnf config-manager --set-enabled crb# Oracle Linux:# dnf install -y oracle-epel-release-el9 && dnf config-manager --set-enabled ol9_codeready_builder ol9_developer_EPEL# RHEL:# subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms# dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm dnf module enable -y php:remi-8.5
# 2. Add the repository file tee /etc/yum.repos.d/suricatavel.repo <<EOF[suricatavel]name=Suricatavel Repositorybaseurl=https://repository.suricatavel.org/rpm/stable/enabled=1gpgcheck=1repo_gpgcheck=1gpgkey=https://repository.suricatavel.org/pubkey.gpgEOF
# 3. Rebuild the cache dnf makecacheFor FreeBSD based systems, configure the pkg repository.
# 1. Setup Fingerprintsmkdir -p /usr/local/etc/pkg/fingerprints/suricatavel/trustedfetch -o /usr/local/etc/pkg/fingerprints/suricatavel/trusted/suricatavel \ https://repository.suricatavel.org/freebsd/fingerprints/trusted/suricatavel
# 2. Add Repository Configurationcat <<EOF > /usr/local/etc/pkg/repos/suricatavel.confsuricatavel: { url: "pkg+https://repository.suricatavel.org/freebsd", signature_type: "fingerprints", fingerprints: "/usr/local/etc/pkg/fingerprints/suricatavel", enabled: yes}EOF
# 3. Update Indexpkg updateFor UniFi OS consoles and other appliances where packages cannot be installed. The binary carries PHP 8.5 and the extensions the agent needs, and keeps everything in its own directory: put it in /data, which survives firmware updates.
-
Download
suricatavel-agent-x86_64orsuricatavel-agent-aarch64(uname -mon the appliance tells which) from the Releases page. -
Copy it to the appliance and make it executable:
Terminal window ssh root@<ip> mkdir -p /data/suricatavel-agentscp suricatavel-agent-aarch64 root@<ip>:/data/suricatavel-agent/ssh root@<ip> chmod +x /data/suricatavel-agent/suricatavel-agent-aarch64 -
Create its database:
Terminal window cd /data/suricatavel-agent./suricatavel-agent-aarch64 migrate --force
On its first run, and on the first run of each new version, the binary extracts the agent to suricatavel-agent.d/ next to itself (about 30 MB) and removes the copy of the previous version. The configuration (.env) and the state (storage/: identity, mTLS key and certificates, event buffer and database) stay in that directory too. Unlike the packages, the binary runs as root.
2. Install package
Section titled “2. Install package” apt-get install -y suricatavel-agent dnf install -y suricatavel-agentpkg install suricatavel-agentNothing to install: the binary is all there is.
Agent registration
Section titled “Agent registration”The agent enrols with a join string: generate one in the controller, in Sensors, with the Agent join string action. Registration pins the controller CA from the join string, obtains the mTLS client certificate, keeps the agent channel URL with the agent identity and checks the channel with a first heartbeat.
# Packagessudo suricatavel-agent register --join='<join string>'
# Static binary (UniFi)cd /data/suricatavel-agent./suricatavel-agent-aarch64 agent:register --join='<join string>'Restart the agent afterwards so it uses the new agent channel.
Configuration
Section titled “Configuration”Typical environment variables, in /etc/suricatavel-agent/.env (/usr/local/etc/suricatavel-agent/.env on FreeBSD):
SURICATA_EVE_JSON_PATHS: Single path or comma-separated list of paths toeve.json(default:/var/log/suricata/eve.json).AGENT_TRANSPORT_DRIVER:http(default) orkafka.AGENT_CONTROLLER_URL: only for an agent that is not enrolled yet. Registration keeps the agent channel URL of the join string with the agent identity (app/pki/identity.jsonin the state directory), and that one wins:registerdoes not rewrite.env.KAFKA_BROKERS: List of brokers, e.g.,kafka1:9092,kafka2:9092(if using Kafka).KAFKA_TOPIC: Events topic name (default:suricatavel-events).KAFKA_HEARTBEAT_TOPIC: Heartbeats topic name (default:suricatavel-heartbeats).- Security (if using Kafka):
KAFKA_SSL_ENABLED,KAFKA_SSL_CA_LOCATION,KAFKA_SSL_CERTIFICATE_LOCATION,KAFKA_SSL_KEY_LOCATION,KAFKA_SASL_ENABLED,KAFKA_SASL_MECHANISM,KAFKA_SASL_USERNAME,KAFKA_SASL_PASSWORD, etc. - Buffer and retries:
AGENT_BUFFER_MAX_RETRY_ATTEMPTS,AGENT_BUFFER_RETRY_WAIT_TIME(in seconds). The buffer drains in batches whose size adapts betweenAGENT_BUFFER_RETRY_BATCH_MIN(100) andAGENT_BUFFER_RETRY_BATCH_MAX(5000) to stay nearAGENT_BUFFER_RETRY_BATCH_TARGET_MS(1000) per batch, several batches per pass while a backlog remains. - Heartbeats:
AGENT_HEARTBEAT_ENABLED,AGENT_HEARTBEAT_INTERVAL(in seconds).
You can manage the agent as a background service through your chosen process manager.
The package automatically installs a hardened suricatavel-agent.service unit on systemd-based Linux systems (Debian, Ubuntu, RHEL, Rocky, AlmaLinux, etc.):
sudo systemctl enable --now suricatavel-agentCheck status and view logs:
sudo systemctl status suricatavel-agentjournalctl -u suricatavel-agent -fFor environments running Supervisor (such as containers or systems without systemd), configure suricatavel-agent in your Supervisor configuration directory (e.g. /etc/supervisor/conf.d/suricatavel-agent.conf):
[program:suricatavel-agent]command=/usr/bin/suricatavel-agent startuser=suricatavelautostart=trueautorestart=truestdout_logfile=/var/log/suricatavel-agent/agent.logstderr_logfile=/var/log/suricatavel-agent/agent-error.logUpdate Supervisor and start the service:
sudo supervisorctl rereadsudo supervisorctl updatesudo supervisorctl start suricatavel-agentOn FreeBSD-based systems (OPNsense, pfSense, vanilla FreeBSD), enable and start the service using sysrc and service:
sysrc suricatavel_agent_enable=YESservice suricatavel_agent startCheck status:
service suricatavel_agent statusCommand-line tool and privileges
Section titled “Command-line tool and privileges”You can also manage the agent service lifecycle directly using the suricatavel-agent command-line tool. It reads the service manager configured in /etc/suricatavel-agent/service-manager (/usr/local/etc/suricatavel-agent/service-manager on FreeBSD) — systemd, supervisor, or rcd — and invokes the corresponding process engine through suricatavel-agent-helper:
# Manage the service via the configured process managersudo suricatavel-agent statussudo suricatavel-agent startsudo suricatavel-agent stopsudo suricatavel-agent restartRunning in the foreground (debugging), as the suricatavel user, with the log on screen:
sudo suricatavel-agent start -vvsuricatavel-agent (status, start, stop, restart, update, register, positions…) behaves the same with or without sudo, but it never runs PHP as root. Run as root, it runs PHP as the suricatavel user and keeps suricatavel-agent-helper running as root only while the command lasts, for the service and package operations that need it. Run as suricatavel, those operations fail for lack of permissions and everything else works.
- The helper drives the service manager named in
/etc/suricatavel-agent/service-manager(/usr/local/etc/suricatavel-agent/service-manageron FreeBSD):systemd,supervisororrcd. The package or Ansible writes it. - The code (
/usr/share/suricatavel-agent) is owned by root and read-only for the agent. Thesuricataveluser owns only its configuration (/etc/suricatavel-agent/.env, mode0600), its state (/var/lib/suricatavel-agent: identity, mTLS key and certificates, event buffer and database; also its home), its caches (/var/cache/suricatavel-agent) and its logs (/var/log/suricatavel-agent). On FreeBSD the configuration is in/usr/local/etc/suricatavel-agent, the state in/var/db/suricatavel-agentand the code in/usr/local/share/suricatavel-agent. The mTLS private key,app/pki/client.key, has mode0600. - The systemd unit is hardened. The agent can write only its state, caches and logs, and its output goes to the journal (
journalctl -u suricatavel-agent).
Integration with Suricatavel
Section titled “Integration with Suricatavel”Suricatavel can consume events sent by the agent from Kafka (kafka.topics.events) or via HTTP.
Ensure Suricatavel’s configuration matches the agent’s transport.
Troubleshooting
Section titled “Troubleshooting”- Adjust batch size and retry intervals if you observe high latencies or spikes.
- Check logs in
/var/log/suricatavel-agent/. You can adjust Kafka debug level inconfig/kafka.php. - If Kafka is unavailable, events will be saved in the SQLite buffer; they will be retried automatically upon connectivity recovery.

