pySigma VictoriaLogs (LogsQL) backend
Project description
pySigma backend for VictoriaLogs (LogsQL)
Convert Sigma detection rules to LogsQL queries that run against VictoriaLogs.
Sigma rule (YAML)
│
▼
pySigma core
│
▼
VictoriaLogsBackend ──► field:="value" AND other:~"regex"
Install
The recommended way is via sigma-cli's plugin system:
pip install sigma-cli
sigma plugin install victorialogs
Or directly as a library:
pip install pysigma-backend-victorialogs
First query
sigma convert -t victorialogs path/to/rule.yml
Programmatic use:
from sigma.collection import SigmaCollection
from sigma.backends.victorialogs import VictoriaLogsBackend
rule = SigmaCollection.from_yaml("""
title: SSH login failure
logsource:
product: linux
service: auth
detection:
sel:
program: sshd
message|contains: "Failed password"
condition: sel
""")
print(VictoriaLogsBackend().convert(rule)[0])
# program:="sshd" AND message:~"Failed password"
See docs/getting_started.md for the full walkthrough including a local VictoriaLogs container.
Compatibility
| Component | Supported versions |
|---|---|
| Python | 3.10, 3.11, 3.12, 3.13, 3.14 |
| pySigma | ^1.1.0 |
| VictoriaLogs | v1.50.0 (pinned by digest in CI) |
CI pins victoriametrics/victoria-logs:v1.50.0 by sha256 digest for
reproducibility; bumps follow the procedure in
CONTRIBUTING.md.
Older or newer VL versions are not actively tested but should work as
long as they parse the LogsQL constructs listed in
docs/mapping.md.
Mapping summary
| Sigma feature | LogsQL output |
|---|---|
field: value |
field:="value" |
field|contains: x |
field:~"x" (regex) |
field|startswith: x |
field:="x"* (native prefix) |
field|endswith: x |
field:~"x$" (regex anchor) |
field|re: pattern |
field:~"pattern" |
field|cidr: 10.0.0.0/8 |
field:ipv4_range("10.0.0.0/8") |
field|cidr: ::1/128 |
field:ipv6_range("::1/128") |
field|gte: 1024 |
field:>=1024 |
field|fieldref: other |
field:eq_field(other) |
field|exists: true |
field:* |
field: null |
field:"" |
| field IN [a, b] | field:in("a", "b") |
| event_count correlation | _time:Xm <search> | stats by (g) count() as event_count | filter event_count:>=N |
Full reference: docs/mapping.md.
Pipelines
Sigma rules use a neutral field taxonomy (Image, CommandLine,
EventID, …) that does not match how any specific log shipper writes
records. Pick a pipeline that matches your ingestion path:
| Pipeline | Targets | Renames |
|---|---|---|
victorialogs |
(no-op placeholder) | none |
victorialogs_windows_eventlog |
Winlogbeat / Vector ECS Windows ingest | EventID→winlog.event_id, EventData→winlog.event_data.*, channel selectors |
victorialogs_journald |
systemd-journal native fields | Image→_EXE, CommandLine→_CMDLINE, Message→MESSAGE, … |
victorialogs_caddy |
Caddy v2 JSON access logs | cs-method→request.method, cs-uri-*→request.uri, sc-status→status, … |
victorialogs_suricata |
Suricata EVE JSON | dst_ip→dest_ip, QueryName→dns.rrname, TlsServerName→tls.sni, … |
victorialogs_podman |
podman/docker journald CONTAINER_* |
ContainerName→CONTAINER_NAME, ImageName→IMAGE_NAME, … |
sigma convert -t victorialogs -p victorialogs_journald rule.yml
sigma convert -t victorialogs -p victorialogs_windows_eventlog rule.yml
sigma convert -t victorialogs -p victorialogs_caddy rule.yml
Each pipeline applies only to rules whose logsource matches its target
(e.g. product: linux for journald, category: webserver for Caddy,
category: network or product: zeek|suricata for the EVE pipeline);
other rules pass through untouched. Stack pipelines with multiple -p
flags when, for example, podman containers ship through journald.
Output formats
| Format | Output |
|---|---|
default |
Plain LogsQL query strings (one per rule) |
vmalert |
vmalert rule group YAML (type: vlogs) for VictoriaLogs |
vmalert (deploy as alerting rules)
sigma convert -t victorialogs -f vmalert -p victorialogs_journald \
rules/*.yml > sigma-rules.yaml
The output is a single rule group ready to feed to vmalert pointed at a VictoriaLogs datasource:
vmalert \
-datasource.url=http://victorialogs:9428 \
-rule.defaultRuleType=vlogs \
-rule=sigma-rules.yaml \
-notifier.url=http://alertmanager:9093
Each Sigma rule becomes one alert with expr wrapped as
<query> | stats count() as matches | filter matches:>0 (correlation
rules already aggregate and pass through unwrapped). vmalert auto-prepends
_time:<group_interval>, so the emitted expressions are time-agnostic by
design — change the evaluation window via the group interval (default
5m) rather than editing every query. Sigma level maps to
labels.severity and id to labels.sigma_id. Requires vmalert ≥ v1.93
(when type: vlogs was added). See
docs/mapping.md §14 for the
full mapping.
Limitations
- Temporal correlations (
temporal,temporal_ordered) are unsupported — LogsQL has no native multi-event window join. -search.maxQueryLendefaults to 16 KiB; seven SigmaHQ rules emit queries above this. Raise the flag at VL startup if you need them:victoria-logs -search.maxQueryLen=524288 ...- No native single-character wildcard — Sigma
?routes to regex. - Case-sensitivity is the default (LogsQL
:=).
Full details and workarounds: docs/limitations.md.
Documentation
- Getting started — install → first query → live VL.
- Mapping reference — exhaustive Sigma → LogsQL spec.
- Architecture — how the backend works (for contributors).
- Limitations — what we cannot do, and why.
- Security policy — threat model + reporting.
- Contributing — dev setup + Conventional Commits.
License
MIT © aris1009
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysigma_backend_victorialogs-0.1.1.tar.gz.
File metadata
- Download URL: pysigma_backend_victorialogs-0.1.1.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
305a62822262ec002c5a818ebf8072cf1072b3712b1bd30081ab35a2bb271eba
|
|
| MD5 |
c68b31bc0c0c105048e4d2319cb1db02
|
|
| BLAKE2b-256 |
582b0f94821fe81d95c704f3d2ff3ab220ce768bc1469799248ab1a5c4684165
|
Provenance
The following attestation bundles were made for pysigma_backend_victorialogs-0.1.1.tar.gz:
Publisher:
release-please.yml on aris1009/pySigma-backend-victorialogs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysigma_backend_victorialogs-0.1.1.tar.gz -
Subject digest:
305a62822262ec002c5a818ebf8072cf1072b3712b1bd30081ab35a2bb271eba - Sigstore transparency entry: 1534920041
- Sigstore integration time:
-
Permalink:
aris1009/pySigma-backend-victorialogs@01e283cebae1a2b1577f965d8bad0bdd5e0f74d6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aris1009
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@01e283cebae1a2b1577f965d8bad0bdd5e0f74d6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pysigma_backend_victorialogs-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pysigma_backend_victorialogs-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a0112d0c902883b9c2da6f68887a11bad4b2ba9a472c7d46fef8bff5550ae86
|
|
| MD5 |
41e4c6c9551ec8051b487c0be9a9a174
|
|
| BLAKE2b-256 |
71e8b9d41d06289c0662089d23f19945946ba8e28872ead62f97bbb241966ed0
|
Provenance
The following attestation bundles were made for pysigma_backend_victorialogs-0.1.1-py3-none-any.whl:
Publisher:
release-please.yml on aris1009/pySigma-backend-victorialogs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysigma_backend_victorialogs-0.1.1-py3-none-any.whl -
Subject digest:
4a0112d0c902883b9c2da6f68887a11bad4b2ba9a472c7d46fef8bff5550ae86 - Sigstore transparency entry: 1534920105
- Sigstore integration time:
-
Permalink:
aris1009/pySigma-backend-victorialogs@01e283cebae1a2b1577f965d8bad0bdd5e0f74d6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aris1009
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@01e283cebae1a2b1577f965d8bad0bdd5e0f74d6 -
Trigger Event:
push
-
Statement type: