Registry / data / eql
library1.0.0pypypiunverified

EQL (Event Query Language) is a high-level query language from Microsoft for expressing relationships between events, primarily used in security analytics and threat hunting contexts. The Python library provides tools to parse, validate, and transform EQL queries into an Abstract Syntax Tree (AST). The current stable version is 1.0.0, with releases typically tied to feature enhancements or bug fixes, maintaining a stable API.

pip install eql
INSTALL
IMPORT
SIG · EQL
E
eql
datapythonv1.0.0
Install
1.7s avg
Import
818ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.842s · 19.5MB
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 1.7s · import 0.793s · 20MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

parse
✓ from eql import parse
✗ from eql import parse

This quickstart demonstrates how to parse a basic EQL query string using the `eql.parse()` function. The function returns an `eql.Query` object, which represents the Abstract Syntax Tree (AST) of the query. This object can then be inspected or used as input for an EQL execution engine (which is not part of this library).

import eql # Define a simple EQL query string eql_query_string = "process where eventid == 1 and process_name == 'powershell.exe'" # Parse the EQL query string into an EQL Query object (AST) parsed_query = eql.parse(eql_query_string) print(f"Original EQL: {eql_query_string}") print(f"Parsed Query Type: {type(parsed_query)}") print(f"Parsed Query (JSON representation): {parsed_query.to_json(indent=2)}") # The parsed_query object can then be transformed or evaluated by an external engine.
eql --version
Debug
Known issues
gotchaThe `eql` Python library is primarily an EQL *parser* and AST generator. It does NOT include an event processing or execution engine to run queries against live event streams or data lakes. You will need to implement or integrate with a separate system to evaluate the parsed queries.
fix
Understand that `eql.parse()` returns an AST. Integrate this AST with an external EQL evaluation engine or implement your own event processing logic.
affects: All versions
gotchaEQL syntax is strict and unforgiving. Even minor typos, incorrect casing for keywords (e.g., `where` vs `WHERE`), or unsupported constructs will lead to parsing errors.
fix
Always refer to the official EQL specification or documentation for correct syntax. Use a linter or formatter if available. Common errors include missing quotes around strings or incorrect logical operators.
affects: All versions
gotchaThe library relies on the `ply` (Python Lex-Yacc) package for parsing. While generally robust, conflicts can arise if other dependencies in your project require a significantly different version of `ply`, or if there are environment-specific issues during `ply`'s installation or operation.
fix
Ensure `ply` is installed correctly. If conflicts arise, consider using a dedicated virtual environment or checking for version compatibility issues with other libraries.
affects: All versions
gotchaEQL queries are highly dependent on the schema of the events they are intended to query. Queries referencing non-existent fields or fields with incorrect data types will lead to logical errors or runtime failures in the *execution engine*, not necessarily during parsing.
fix
Rigorously validate your EQL queries against the actual schema of your event data. Implement schema validation in your EQL execution pipeline.
affects: All versions
Upgrade
Version history
1.0.0latest on PyPI · released Nov 18, 2025
Audit
Dependencies
plyrequiredRequired for parsing EQL syntax into an AST.
Agent activity
32 hits · last 30 days
node
28
Resources
eql — pip install eql · libregistry