Skip to content
DuckDB community extension

duck_hunt

Parse and analyze test results, build outputs, and CI/CD pipeline logs from 110+ formats with severity filtering, format auto-detection, and context extraction

01 / SETUP

Install and load

Run these commands in a Haybarn SQL session. The extension is available from the community repository.

Haybarn 2.0.0 · SQL
INSTALL duck_hunt FROM community;
LOAD duck_hunt FROM community;

Try it in a temporary SQL session with duck_hunt already loaded. Queries run in this tab; examples using files or services need their own setup.

Using upstream DuckDB? Follow the maintainer’s installation instructions.

02 / QUERY

Usage example

Parse build errors (warnings and above)

SQL
-- Parse build errors (warnings and above)
SELECT ref_file, ref_line, message
FROM read_duck_hunt_log('build.log', 'auto', severity_threshold := 'warning')
WHERE status = 'ERROR';

-- Parse test results with all events
SELECT test_name, status, execution_time
FROM read_duck_hunt_log('pytest.json', 'pytest_json', severity_threshold := 'all')
WHERE status = 'FAIL';

-- Process multiple files, skip failures (new in v1.4.0)
SELECT * FROM read_duck_hunt_log('logs/*.json', ignore_errors := true);

-- Control log_content size for memory efficiency (new in v1.4.0)
SELECT * FROM read_duck_hunt_log('huge.log', content := 200);
SELECT * FROM read_duck_hunt_log('huge.log', content := 'smart');

-- Extract surrounding log lines for context (new in v1.6.0)
SELECT ref_file, message, context
FROM read_duck_hunt_log('build.log', 'make_error', context := 3);

-- Parse GitHub Actions ZIP archives (new in v1.4.0, requires zipfs)
-- INSTALL zipfs FROM community; LOAD zipfs;
SELECT job_name, severity, message
FROM read_duck_hunt_workflow_log('workflow_run.zip', 'github_actions_zip')
WHERE severity = 'error';

-- Debug format detection
SELECT format, can_parse, events_produced, is_selected
FROM duck_hunt_diagnose_read('build.log');

-- LATERAL join for per-file parsing (new in v1.7.0)
SELECT f.filename, e.*
FROM glob('logs/*.log') f,
LATERAL read_duck_hunt_log(f.filename) e;

-- Comma-separated format fallback chain (new in v1.9.0)
SELECT ref_file, ref_line, message
FROM read_duck_hunt_log('build.log', 'gcc_text,make_error,cmake_build');

-- Load custom parser from config file (new in v1.8.0)
SELECT duck_hunt_load_parser_config('my_parser.yml');

-- Build health badge
SELECT status_badge(
  COUNT(*) FILTER (WHERE status = 'ERROR'),
  COUNT(*) FILTER (WHERE status = 'WARNING')
) FROM read_duck_hunt_log('build.log', 'auto');

Provided by teaguesterling. Not yet verified on Haybarn 2.0.0.

Sample data & setup

About this extension

Duck Hunt is a comprehensive DuckDB extension for parsing and analyzing development tool outputs. It provides a unified SQL interface to query test results, build logs, linting output, and CI/CD pipeline data from 90+ tools and formats.

Severity Filtering: Filter events by severity level: 'all' < 'info' < 'warning' < 'error' < 'critical'

Project overview from the community descriptor.

Documentation and resources

Project and build details
Repository
teaguesterling/duck_hunt
License
Apache-2.0
Maintainers
teaguesterling
Written in
C++
Build source
72149b4fdabd
Build definition
Community descriptor