Windows event logs (EVTX)
Parse Windows .evtx event-log files into queryable SQL rows for forensics and incident response
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available · $10/month organization minimum
Use with an agent
Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.
npx skills add Query-farm/vgi-skills --skill orchard
Copy this request into your coding agent to get started.
Use https://query.farm/products/orchard/connectors/evtx/index.md to help me query Windows event logs (EVTX) with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.
See what you can query
Example output · captured
- Connector release
- v0.5.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT record_id, event_id, provider, time_created
FROM evtx.main.evtx_records(getvariable('evtx_sample'))
ORDER BY record_id;
| record_id | event_id | provider | time_created |
|---|---|---|---|
| 1 | 5152 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:34.346000 |
| 2 | 4611 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:36.686000 |
| 3 | 4776 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:36.686000 |
| 4 | 4625 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:36.717200 |
| 5 | 5152 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:57.090800 |
Quick start
Choose where to run Windows event logs (EVTX), then follow the steps below.
The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.
1. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
2. Attach the connector
Attach the release directly
Downloads the latest release for your platform and caches it locally.
ATTACH 'evtx' AS evtx (
TYPE vgi,
LOCATION 'github-auto://Query-farm/vgi-evtx'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'evtx' AS evtx (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-evtx:0.5.0'
);
3. Run a query
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT record_id, event_id, provider, time_created
FROM evtx.main.evtx_records(getvariable('evtx_sample'))
ORDER BY record_id;
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connector’s deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'evtx' AS evtx
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT record_id, event_id, provider, time_created
FROM evtx.main.evtx_records(getvariable('evtx_sample'))
ORDER BY record_id;
Query Farm operates Windows event logs (EVTX) for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use evtx as the catalog alias for the query below.
4. Run a query
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT record_id, event_id, provider, time_created
FROM evtx.main.evtx_records(getvariable('evtx_sample'))
ORDER BY record_id;
Technical details
- Verified connector release
- v0.5.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
Pin a version for production
When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.
Attach the release directly
Uses the verified release each time you attach the connector.
ATTACH 'evtx' AS evtx (
TYPE vgi,
LOCATION 'github-auto://Query-farm/[email protected]'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'evtx' AS evtx (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-evtx:0.5.0'
);
Overview
Windows Event Log (.evtx) parsing for defensive DFIR — turn event-log files into queryable rows.
Query Windows Event Logs directly in DuckDB: this VGI extension turns binary .evtx files into Apache Arrow rows so you can run digital-forensics and incident-response (DFIR) analysis, threat hunting, and log triage entirely in SQL — no external tooling, no network access, no scripting.
What it does
The Windows Event Log (.evtx, the binary ElfFile format that backs the Security, System, Application, PowerShell, and Sysmon channels) is the primary evidence source for Windows DFIR. This extension reads those files — including logs pulled from potentially compromised hosts — and exposes every event record as a queryable row, with convenience columns for the event id, provider, channel, source computer, severity level, and creation time, plus the complete original event preserved as JSON. It is built for incident responders, threat hunters, detection engineers, SOC analysts, and anyone who would rather join, filter, and aggregate event logs in SQL than wrangle them in a GUI.
How it works
Parsing is powered by the battle-tested evtx Rust crate (API docs on docs.rs), which decodes the BinXML chunks of the Windows event-logging format. Everything runs offline inside the worker — it never touches the network — and every entry point is hardened against hostile input: malformed, truncated, or deliberately corrupted files yield NULL / false / no rows and never crash the worker. Input may be supplied either inline as a BLOB (for example from read_blob()) or as a VARCHAR filesystem path.
Working in SQL
Because every event becomes an ordinary row, you build timelines by filtering on provider and creation time, surface the noisiest activity by grouping and counting event ids, and pivot from triage to detection: the preserved event JSON composes with the companion vgi-sigma worker to run Sigma detection rules straight against your logs. The curated windows_event_id_reference view lets you look up what a given event id means and join it onto parsed records for readable timelines. Runnable, catalog-qualified queries for every function and the reference view are attached to each object and to this schema as example queries.
Catalog
Everything evtx exposes once attached — read straight from the worker's
released build.
main 1 view · 3 functions
Windows Event Log (.evtx) parsing and inspection functions.
Schema examples (7)
Validate that a file's bytes (a sample Security log fetched by URL) are a parseable .evtx before loading it.
SELECT evtx.main.is_valid_evtx((SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')));
Count how many event records a .evtx file (a sample Security log fetched by URL) contains.
SELECT evtx.main.evtx_record_count((SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')));
Explode a .evtx file into one row per event record, ordered by record id (the sample log's bytes are fetched by URL into a variable, since table-function arguments must be constants).
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT record_id, event_id, provider, time_created
FROM evtx.main.evtx_records(getvariable('evtx_sample'))
ORDER BY record_id;
| record_id | event_id | provider | time_created |
|---|---|---|---|
| 1 | 5152 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:34.346000 |
| 2 | 4611 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:36.686000 |
| 3 | 4776 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:36.686000 |
| 4 | 4625 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:36.717200 |
| 5 | 5152 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:57.090800 |
Rank event ids by how often they occur to surface the noisiest activity.
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT event_id, count(*) AS n
FROM evtx.main.evtx_records(getvariable('evtx_sample'))
GROUP BY event_id
ORDER BY n DESC;
3 more examples
Label each parsed record with its human-readable meaning by LEFT JOINing the event id reference onto evtx_records (meaning is NULL for ids the reference does not catalogue).
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT r.record_id, r.event_id, ref.name AS meaning, r.time_created
FROM evtx.main.evtx_records(getvariable('evtx_sample')) AS r
LEFT JOIN evtx.main.windows_event_id_reference AS ref ON ref.event_id = r.event_id AND ref.channel = r.channel
ORDER BY r.record_id;
Hunt failed logons and lockouts: select the event ids from the reference by name, then pull the targeted account and source IP address out of each matching record's event_json.
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT r.record_id, r.time_created, ref.name, r.event_json->>'$.Event.EventData.TargetUserName' AS target_user, r.event_json->>'$.Event.EventData.IpAddress' AS source_ip
FROM evtx.main.evtx_records(getvariable('evtx_sample')) AS r
JOIN evtx.main.windows_event_id_reference AS ref ON ref.event_id = r.event_id AND ref.channel = r.channel
WHERE ref.name IN ('Failed logon', 'Account locked out')
ORDER BY r.time_created, r.record_id;
Triage a set of collected files (here a sample .evtx and a README fetched by URL): flag which ones are parseable .evtx logs and how many event records each holds (non-evtx files show valid = false and 0 records).
SELECT filename, evtx.main.is_valid_evtx(content) AS valid,
evtx.main.evtx_record_count(content) AS records
FROM read_blob(['https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/README.md', 'https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx'])
ORDER BY filename;
windows_event_id_reference
Curated registry of well-known Windows Event IDs (Security, System, Sysmon, PowerShell) with a short name and DFIR relevance note; browsable and joinable onto evtx_records.event_id.
Look up the meaning and DFIR relevance of a single Windows event id.
SELECT name, dfir_use
FROM evtx.main.windows_event_id_reference
WHERE event_id = 4688;
List the curated Security-channel event ids in numeric order.
SELECT event_id, name
FROM evtx.main.windows_event_id_reference
WHERE channel = 'Security'
ORDER BY event_id;
Hunt failed logons and lockouts: select the event ids from the reference by name, then pull the targeted account and source IP address out of each matching record's event_json.
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT r.record_id, r.time_created, ref.name, r.event_json->>'$.Event.EventData.TargetUserName' AS target_user, r.event_json->>'$.Event.EventData.IpAddress' AS source_ip
FROM evtx.main.evtx_records(getvariable('evtx_sample')) AS r
JOIN evtx.main.windows_event_id_reference AS ref ON ref.event_id = r.event_id AND ref.channel = r.channel
WHERE ref.name IN ('Failed logon', 'Account locked out')
ORDER BY r.time_created, r.record_id;
evtx_record_count (input ANY)
Number of event records in a .evtx file (BLOB bytes or VARCHAR path); 0 for malformed/garbage input
Count the event records in a sample Security .evtx file read as a BLOB from a URL (7 records).
SELECT evtx.main.evtx_record_count((SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')));
Non-evtx bytes count as 0 records (hostile input is handled, not an error).
SELECT evtx.main.evtx_record_count('not a real evtx'::BLOB) AS records;
is_valid_evtx (input ANY)
True if the input is a parseable .evtx (has the ElfFile magic and the parser constructs); false for malformed/garbage input
Check whether a file's bytes (a sample Security log fetched by URL) are a parseable .evtx before processing.
SELECT evtx.main.is_valid_evtx((SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')));
Non-evtx bytes are reported as not valid (false), not an error.
SELECT evtx.main.is_valid_evtx('not a real evtx'::BLOB) AS valid;
Triage a set of collected files (here a sample .evtx and a README fetched by URL): flag which ones are parseable .evtx logs and how many event records each holds (non-evtx files show valid = false and 0 records).
SELECT filename, evtx.main.is_valid_evtx(content) AS valid,
evtx.main.evtx_record_count(content) AS records
FROM read_blob(['https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/README.md', 'https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx'])
ORDER BY filename;
evtx_records (input BLOB) +1 overload
Parse a .evtx file (BLOB bytes or VARCHAR path) into one row per event record; event_json carries the full normalized event JSON
evtx_records(input BLOB)evtx_records(input VARCHAR)
Explode a .evtx file into one row per event record, ordered by record id. Table-function arguments must be constants, so the sample log's bytes are fetched by URL into a variable first.
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT record_id, event_id, provider, time_created
FROM evtx.main.evtx_records(getvariable('evtx_sample'))
ORDER BY record_id;
| record_id | event_id | provider | time_created |
|---|---|---|---|
| 1 | 5152 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:34.346000 |
| 2 | 4611 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:36.686000 |
| 3 | 4776 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:36.686000 |
| 4 | 4625 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:36.717200 |
| 5 | 5152 | Microsoft-Windows-Security-Auditing | 2016-06-29T15:24:57.090800 |
Label each parsed record with its human-readable meaning by LEFT JOINing the event id reference onto evtx_records (meaning is NULL for ids the reference does not catalogue).
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT r.record_id, r.event_id, ref.name AS meaning, r.time_created
FROM evtx.main.evtx_records(getvariable('evtx_sample')) AS r
LEFT JOIN evtx.main.windows_event_id_reference AS ref ON ref.event_id = r.event_id AND ref.channel = r.channel
ORDER BY r.record_id;
Rank event ids by frequency to surface the noisiest activity in a log.
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT event_id, count(*) AS n
FROM evtx.main.evtx_records(getvariable('evtx_sample'))
GROUP BY event_id
ORDER BY n DESC;
3 more examples
SELECT count(*) AS n FROM evtx.main.evtx_records('not a real evtx'::BLOB);
SELECT evtx.main.is_valid_evtx('not a real evtx'::BLOB) AS valid;
SELECT evtx.main.evtx_record_count('not a real evtx'::BLOB) AS records;
Try these queries
Validate that a file's bytes (a sample Security log fetched by URL) are a parseable .evtx before loading it.
SELECT evtx.main.is_valid_evtx((SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')));
Uses is_valid_evtx
Count how many event records a .evtx file (a sample Security log fetched by URL) contains.
SELECT evtx.main.evtx_record_count((SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')));
Uses evtx_record_count
Rank event ids by how often they occur to surface the noisiest activity.
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT event_id, count(*) AS n
FROM evtx.main.evtx_records(getvariable('evtx_sample'))
GROUP BY event_id
ORDER BY n DESC;
Uses evtx_records
Label each parsed record with its human-readable meaning by LEFT JOINing the event id reference onto evtx_records (meaning is NULL for ids the reference does not catalogue).
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT r.record_id, r.event_id, ref.name AS meaning, r.time_created
FROM evtx.main.evtx_records(getvariable('evtx_sample')) AS r
LEFT JOIN evtx.main.windows_event_id_reference AS ref ON ref.event_id = r.event_id AND ref.channel = r.channel
ORDER BY r.record_id;
Hunt failed logons and lockouts: select the event ids from the reference by name, then pull the targeted account and source IP address out of each matching record's event_json.
SET VARIABLE evtx_sample = (SELECT content FROM read_blob('https://raw.githubusercontent.com/Query-farm/vgi-evtx/v0.4.0/test/sql/data/sample-security.evtx')); SELECT r.record_id, r.time_created, ref.name, r.event_json->>'$.Event.EventData.TargetUserName' AS target_user, r.event_json->>'$.Event.EventData.IpAddress' AS source_ip
FROM evtx.main.evtx_records(getvariable('evtx_sample')) AS r
JOIN evtx.main.windows_event_id_reference AS ref ON ref.event_id = r.event_id AND ref.channel = r.channel
WHERE ref.name IN ('Failed logon', 'Account locked out')
ORDER BY r.time_created, r.record_id;
Look up the meaning and DFIR relevance of a single Windows event id.
SELECT name, dfir_use
FROM evtx.main.windows_event_id_reference
WHERE event_id = 4688
5 more examples in the Catalog, each listed under the table or function it uses.
Questions it can answer
Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.
- Using the evtx worker's built-in Windows Event ID reference data, what is the short name for event id 4688?
- Using the evtx worker's Windows Event ID reference, how many distinct Security-channel event ids does it catalogue?
Windows event logs (EVTX) is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.
Related workers
NTFS MFT
Security & forensics
Turn a collected NTFS $MFT into a SQL forensic timeline with full paths, timestomp flags, deleted records, and data streams
Registry hives
Security & forensics
Parse offline Windows Registry hive files into SQL rows for forensics, with transaction-log replay and deleted-key recovery
Disassembler
Security & forensics
Disassemble binaries and shellcode, then triage their sections, imports, strings, and MITRE ATT&CK capabilities