Skip to content
Commitpedia
Log in Join & edit

pySigma: the Python library that converts Sigma rules into queries

pySigma parses Sigma detection rules and, with backend plugins, converts them into native queries for Splunk, Elastic, Loki, Sentinel and other log platforms. It is the engine inside the sigma-cli tool.

Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?

Edit history of pySigma: the Python library that converts Sigma rules into queries: 1 recorded edit
Edit history · 1 edit
Type
Repo
Edits
1
Editors
1
First issued
15 Oct 2026
Last edit
15 Oct 2026
Source
SigmaHQ/pySigma

SigmaHQ/pySigma

Stars
601
Forks
158
Language
Python
Licence
LGPL-2.1
Last push
11 Oct 2026

On GitHub: Python library to parse and convert Sigma rules into queries (and whatever else you could imagine)

Open on GitHub

pySigma (about 600 stars on GitHub) is the reference implementation of the Sigma detection rule format as a Python library. It was started in 2021 by Thomas Patzke, one of the two creators of Sigma, as a clean replacement for the original sigmac converter, and it is maintained by the SigmaHQ organisation alongside the rule library described in the encyclopedia entry Sigma: the open detection-rule format for log data. The sigma-cli command line tool is a thin wrapper around it, and several vendors embed the library in their own products.

What it does

A Sigma rule says what to look for in a vendor neutral way; pySigma turns that description into something a real log system can execute. The library has three layers. The core parses rules into Python objects and validates them. Processing pipelines describe how field names and log sources differ in a given environment, for example that a Windows event field is called one thing in Elastic and another in Splunk, and transform the rule accordingly. Backends, each in its own plugin package, generate the final query language: there are backends for Splunk, Elasticsearch and OpenSearch, Microsoft Sentinel and Defender, Grafana Loki, QRadar, CrowdStrike, SQLite and many more. Backends live in separate repositories under SigmaHQ and in third party organisations, and a plugin directory inside pySigma lets sigma-cli find and install them.

Who it is for

  • Detection engineers who maintain rules in Sigma and want them deployed automatically to whatever SIEM the organisation runs.
  • Developers of log platforms who want to offer Sigma support and only need to write a backend.
  • Teams building continuous integration for detection content, since the library can validate every rule in a repository on each commit.
  • Anyone writing scripts that need to inspect or rewrite Sigma rules programmatically.

How to install it

The library is on PyPI as pysigma, and backends as pysigma-backend-NAME. Most people use it through sigma-cli, which installs the library as a dependency and manages plugins:

pipx install sigma-cli
sigma plugin install elasticsearch
sigma version

The documentation explains the rule model, how to write a pipeline for your own field names and how to build a backend. The encyclopedia how-to Try Sigma rules against your own logs shows the conversion end to end.

Credit

pySigma is written and maintained by Thomas Patzke with the SigmaHQ team and backend authors from the community. It is released under the GNU Lesser General Public License version 2.1, which allows it to be used inside commercial products.

Did this work for you?

No votes yet. Be the first.

If it did not work, the report form below tells the editors what went wrong.

See also

  • 0193 Linux logs reference: journalctl, journald storage, logrotate and centralized logging Read and filter systemd journal logs, keep their disk use in check, rotate classic log files with logrotate, and understand when to… Intermediate · Cheat sheet · Linux Article Linux administration · Logs 15 Oct 2026
  • 0291 What is a log? A log is a running record of what a program did and when, written to a file so you can look back… Beginner · Explains an idea · Any system Article Logs 15 Oct 2026
  • 0323 Fix: Failed to start service, how to read systemctl status and journalctl Job for x.service failed tells you only that the service did not start. The real reason is in systemctl status and journalctl… Beginner · Fixes an error · Linux Article Logs · Services & systemd 15 Oct 2026
  • 0371 Where are the logs? journalctl, /var/log and container logs A practical map of where Linux programs write their logs and the commands to read them: journalctl filters, the classic files under… Beginner · Step by step · Linux Article Logs 15 Oct 2026
  • 0373 Loki: ship and search logs Run Loki, Grafana Alloy and Grafana with Docker Compose, collect the systemd journal and /var/log files with a short Alloy configuration, and… Intermediate · Step by step · Linux Article Logs 15 Oct 2026
  • 0432 Try Sigma rules against your own logs Install the sigma-cli converter, take a rule from the public SigmaHQ library, convert it into a query for a log tool you… Intermediate · Step by step · Linux, macOS Article Logs · Security resources & detection 15 Oct 2026

History

Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.

  1. Dominik +2,612 chars

Report a problem

Something wrong, unsafe or copied? Tell the editors.
What is wrong?