Sigma Command Line Interface
This is the Sigma command line interface using the pySigma library to manage, list and convert Sigma rules into query languages.
Getting Started
Installation
The easiest way to install the Sigma CLI is via pipx or pip. For this purpose run one of the following:
python -m pipx install sigma-cli
python -m pip install sigma-cli
on macOS use
python3 -m pip install sigma-cli
brew install sigma-cli
Another way is to run this from source in a virtual environment managed by Poetry:
git clone https://github.com/SigmaHQ/sigma-cli.git
cd sigma-cli
poetry install
poetry shell
Usage
The CLI is available as sigma command. A typical invocation is:
sigma convert -t <backend> -p <processing pipeline 1> -p <processing pipeline 2> [...] <directory or file>
E.g. to convert process creation Sigma rules from a directory into Splunk queries for Sysmon logs run:
sigma convert -t splunk -p sysmon sigma/rules/windows/process_creation
Required backends must be installed using the following command prior to conducting conversions.
To list all available plugins run the following command:
sigma plugin list
Install a plugin of your choice with:
sigma plugin install <backend>
E.g. to install the splunk backend run:
sigma plugin install splunk
Available conversion backends and processing pipelines can be listed with sigma list.
Use -O or --backend-option for passing options to the backend as key=value pairs (-O testparam=123) .
This backend option parameter can be used multiple times (-O first=123 -O second=456).
Backends can support different output formats, e.g. plain queries and a file that can be imported into the target
system. These formats can be listed with sigma list formats <backend> and specified for conversion with the -f
option.
In addition, an output file can be specified with -o.
Example for output formats and files:
sigma convert -t splunk -f savedsearches -p sysmon -o savedsearches.conf sigma/rules/windows/process_creation
Outputs a Splunk savedsearches.conf containing the converted searches.
Separate File Output
For scenarios where you need to convert multiple rules into separate files (e.g., for version control or selective deployment),
use the --output-dir parameter along with --output-filename-template:
sigma convert -t esql -p ecs_windows --output-dir translated_rules/ rules/
This will create a separate file for each converted rule in the translated_rules/ directory.
Template Variables:
The --output-filename-template parameter accepts the following variables:
{path}: Relative source directory path (e.g.,windowsforrules/windows/rule.yml){stem}: Filename without extension (e.g.,ruleforrule.yml){index}: Query index for rules that generate multiple queries (empty if only one query)
Examples:
Flat output structure (all files in one directory):
sigma convert -t esql -p ecs_windows --output-dir translated/ --output-filename-template "{stem}.esql" rules/
Preserve directory structure:
sigma convert -t esql -p ecs_windows --output-dir translated/ --output-filename-template "{path}/{stem}.esql" rules/
Handle rules with multiple queries:
sigma convert -t esql -p ecs_windows --output-dir translated/ --output-filename-template "{stem}-{index}.esql" rules/
Given input structure:
rules/
├── windows/
│ └── rule_1.yml
├── linux/
│ └── rule_2.yml
With --output-filename-template "{path}/{stem}.esql", the output will be:
translated/
├── windows/
│ └── rule_1.esql
├── linux/
│ └── rule_2.esql
Matching Events
Sigma CLI can match log events directly against Sigma rules with the matching engine of pySigma, without conversion into a query language. This is useful for testing rules, quick assessments and offline analysis. It is not intended for high-volume production workloads.
sigma match -e <log file> [-e <log file 2> ...] [options] <rule directory or file>
Supported event formats (-f, detected from the file extension if not given):
jsonl: JSON Lines/NDJSON, one JSON object per line. Default for unknown extensions and standard input (-e -).json: a JSON object or an array of JSON objects. Files that contain JSON Lines are detected.csv: CSV with a header line. Integer values are converted to numbers.evtx: Windows event log files. This requires the optionalevtxpackage, installed withpip install sigma-cli[evtx]orpipx inject sigma-cli evtx.
Rules are only matched against events of their log source. The log source of EVTX events is
derived from the channel and event ID, e.g. Sysmon process creation events (event ID 1) belong to
the category process_creation and to the service sysmon. For other formats, the log source must
be given with --product, --category and --service, or log sources are ignored with
--ignore-logsource. Fields of EVTX events are named as in the Windows event XML (EventID,
Channel, Provider_Name, CommandLine, ...). Nested JSON objects are flattened into dotted field
names (process.command_line) unless --no-flatten is given.
Examples:
Match Sigma rules against a Sysmon event log:
sigma match -e Microsoft-Windows-Sysmon%4Operational.evtx sigma/rules/windows
Match ECS-formatted process creation events with field mapping by a processing pipeline and output the matches as JSON Lines:
sigma match -p ecs_windows --product windows --category process_creation -F jsonl -e events.jsonl sigma/rules/windows/process_creation
Correlation rules are supported. Events are processed in the order of the given files and their
timestamps are taken from --timestamp-field or from well-known fields like @timestamp.
Further options:
-F/--output-format:text(default),jsonorjsonl.-owrites the matches to a file.--fail-on-match: exit with code 1 if any rule matched, e.g. for usage in CI pipelines.--skip-unsupported: ignore rules that can't be used for matching instead of aborting.--skip-invalid: skip events that can't be parsed instead of aborting.-q/--quiet: don't print warnings and the match summary to standard error.
Integration of Backends and Pipelines
Sigma CLI automatically discovers installed pySigma backend and processing pipeline plugins.
Install the plugin package in the same Python environment as Sigma CLI. For plugins listed by
sigma plugin list, use sigma plugin install <identifier>.
For a custom plugin package, use the command matching your Sigma CLI installation:
# Sigma CLI installed with pip
python -m pip install <package-name>
# Sigma CLI installed with pipx
pipx inject sigma-cli <package-name>
# Sigma CLI source checkout managed by Poetry
poetry add <package-name>
Custom plugins provide backend classes under the sigma.backends namespace and processing
pipeline factories under the sigma.pipelines namespace. See the
pySigma plugin guide
for the package layout and exports. No changes to Sigma CLI's source files are needed.
After installation, use sigma list targets and sigma list pipelines to find the identifiers
accepted by sigma convert -t and -p. Use sigma list formats <backend> to list the backend's
output formats for -f.
Maintainers
The project is currently maintained by:
- Thomas Patzke thomas@patzke.org
Metadata
Release files for sigma-cli 4.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sigma_cli-4.1.0.tar.gz | 52.1 kB | With provenance | Details for sigma_cli-4.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sigma_cli-4.1.0-py3-none-any.whl | Python 3 | none | any | Details for sigma_cli-4.1.0-py3-none-any.whl |
Total release size: 110.3 kB
Release files / sigma_cli-4.1.0.tar.gz
| Download URL | sigma_cli-4.1.0.tar.gz |
|---|---|
| Size | 52.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b655003852f43dd6dcb48f0f3cb1a714a2edeb0470921891ae2c3d640700fb2
|
|
BLAKE2b-256 checksum How to use checksums |
2b0ab4b76935f814b4fefa948e022a5c7e69f0c03db095889ae9de6e0633ffaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logRelease files / sigma_cli-4.1.0-py3-none-any.whl
| Download URL | sigma_cli-4.1.0-py3-none-any.whl |
|---|---|
| Size | 58.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4de9e0ac39b576984a436eae37737f7b77dae11f25cdfcbe25e58eecde5b6ff2
|
|
BLAKE2b-256 checksum How to use checksums |
99555f28f1489e0d4bf677109058984b2b499784782b44f403afbc68eb529e89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logSecurity for sigma-cli 4.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sigma_cli-4.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.