Log Analysis SQLite
STDIOTools to create and interact with SQLite database from compressed log files.
Tools to create and interact with SQLite database from compressed log files.
This project provides tools to create an SQLite database from compressed log files and interact with it using the Model Context Protocol (MCP) SQLite server.
python3 -m venv venv source venv/bin/activate pip3 install -r requirements.txt
Place log files in the folder as .gz files, then run:
python3 create_log_db.py
To configure the MCP SQLite server in Cursor-
SQLlite
command
npx -y @smithery/cli@latest run mcp-server-sqlite-npx --config "{\"databasePath\":\"/path/to/thedatbase/logs.db\"}"
create_log_db.py
: Script to extract and parse log files into an SQLite databasequery_logs.py
: Script to directly query the SQLite databaselogs.db
: SQLite database containing parsed log dataThe database contains the following tables:
logs
Tableid
: Unique identifier for each log entrytimestamp
: Timestamp of the log entrythread
: Thread that generated the loglevel
: Log level (INFO, WARN, ERROR, DEBUG)module
: Module that generated the logmessage
: Log message contentsource_file
: Source log fileraw_log
: Raw log entrystack_traces
Tableid
: Unique identifier for each stack tracelog_id
: Reference to the log entry this stack trace belongs tostack_trace
: Full stack trace textparsing_errors
Tableid
: Unique identifier for each parsing errorline
: The line that couldn't be parsedsource_file
: Source log fileerror_message
: Error message explaining why parsing failedtimestamp
: When the parsing error occurredYou can query the database directly using the query_logs.py
script: