Reads and parses Apache HTTP server log files
Maintainer(s):
saygox
Installing and Loading
INSTALL httpd_log FROM community;
LOAD httpd_log;
Example
-- Basic usage (format auto-detected)
SELECT * FROM read_httpd_log('access.log');
-- Read from S3 (requires httpfs extension)
LOAD httpfs;
SELECT * FROM read_httpd_log('s3://bucket/logs/*.log.gz');
-- Auto-select format from httpd.conf
SELECT * FROM read_httpd_log('access.log', conf='/etc/httpd/conf/httpd.conf');
-- Specify format from httpd.conf
SELECT * FROM read_httpd_log('access.log', conf='httpd.conf', format_type='combined')
-- Read with custom format string
SELECT * FROM read_httpd_log('access.log',
format_str='%h %l %u %t "%r" %>s %b %D');
About httpd_log
- Common Log Format and Combined Log Format (auto-detected)
- Glob patterns, S3, gzip, and other sources via DuckDB's filesystem layer
- Automatic format selection from httpd.conf
- Parsed and normalized data (timestamps converted to UTC, request lines decomposed)
- Custom formats via Apache LogFormat syntax
- Dynamic schema generation with automatic column collision resolution
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| read_httpd_conf | table | NULL | NULL | |
| read_httpd_log | table | NULL | NULL |