SQLite MCP サーバーによるログ分析
このプロジェクトは、圧縮されたログ ファイルから SQLite データベースを作成し、Model Context Protocol (MCP) SQLite サーバーを使用してそのデータベースと対話するためのツールを提供します。
インストール手順
ログ ファイルを .gz ファイルとしてフォルダーに配置し、次を実行します。
MCP SQLite サーバー
カーソルでMCP SQLiteサーバーを構成するには、
カーソル設定
MCP
新しいMCPサーバーを追加
名前
SQLliteタイプを
commandに設定するこれをコマンドボックスに入れてください
コンテンツ
create_log_db.py: ログファイルを抽出して解析し、SQLite データベースに保存するスクリプトquery_logs.py: SQLiteデータベースを直接クエリするスクリプトlogs.db: 解析されたログデータを含む SQLite データベース
データベース構造
データベースには次のテーブルが含まれています。
logsテーブル
id: 各ログエントリの一意の識別子timestamp: ログエントリのタイムスタンプthread: ログを生成したスレッドlevel: ログレベル (INFO、WARN、ERROR、DEBUG)module: ログを生成したモジュールmessage: ログメッセージの内容source_file: ソースログファイルraw_log: 生のログエントリ
stack_tracesテーブル
id: 各スタックトレースの一意の識別子log_id: このスタックトレースが属するログエントリへの参照stack_trace: 完全なスタックトレースのテキスト
parsing_errorsテーブル
id: 各解析エラーの一意の識別子line: 解析できなかった行source_file: ソースログファイルerror_message: 解析が失敗した理由を説明するエラーメッセージtimestamp: 解析エラーが発生した時刻
query_logs.pyスクリプトを使用してデータベースを直接クエリできます。
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol server that provides database interaction capabilities through SQLite, enabling users to run SQL queries, analyze business data, and automatically generate business insight memos.Last updated -18MIT License
- -securityAlicense-qualityA Model Context Protocol server implementation that enables AI assistants to execute SQL queries and interact with SQLite databases through a structured interface.Last updated -7MIT License
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs like Claude to interact with SQLite and SQL Server databases, allowing for schema inspection and SQL query execution.Last updated -20,126243MIT License
- -securityFlicense-qualityA Model Context Protocol server providing tools for SQLite database operations (query, add, update, delete users) and mathematical calculations including basic arithmetic, expression evaluation, and statistical analysis.Last updated -1