https://github.com/ruuda/sqlog
Ingest Nginx logs into a SQLite database for easy querying
https://github.com/ruuda/sqlog
logs nginx sqlite
Last synced: 8 months ago
JSON representation
Ingest Nginx logs into a SQLite database for easy querying
- Host: GitHub
- URL: https://github.com/ruuda/sqlog
- Owner: ruuda
- License: apache-2.0
- Created: 2019-02-04T22:05:25.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-03-27T19:31:37.000Z (9 months ago)
- Last Synced: 2025-03-27T20:32:24.993Z (9 months ago)
- Topics: logs, nginx, sqlite
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Sqlog
Ingest Nginx logs into a SQLite database for easy querying.
$ ./sqlog.py --format COMBINED log.sqlite < access.log
$ sqlite3 log.sqlite
> select url, count(*) as n
> from logs
> group by url
> order by n desc
> limit 100
The `queries` directory contains a few interesting queries to run. Use for
example like so:
$ sqlite3 -header log.sqlite < queries/urls_30d.sql \
| column --table --separator '|' \
| less --chop-long-lines
(Sqlite also has `-column`, but it truncates values in combination with
`-header`.)