Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 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 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-24T19:03:48.000Z (12 months ago)
- Last Synced: 2024-01-24T20:27:10.891Z (12 months ago)
- Topics: logs, nginx, sqlite
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 6
- Watchers: 4
- Forks: 2
- 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 100The `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`.)