SQLite MCP 서버를 사용한 로그 분석
이 프로젝트는 압축된 로그 파일에서 SQLite 데이터베이스를 생성하고 MCP(Model Context Protocol) SQLite 서버를 사용하여 해당 데이터베이스와 상호 작용하는 도구를 제공합니다.
설치 지침
지엑스피1
로그 파일을 .gz 파일로 폴더에 넣은 다음, 다음을 실행합니다.
MCP SQLite 서버
커서에서 MCP SQLite 서버를 구성하려면
커서 설정
엠씨피
새로운 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
스크립트를 사용하여 데이터베이스를 직접 쿼리할 수 있습니다.
This server cannot be installed
local-only server
The server can only run on the client's local machine because it depends on local resources.
모델 컨텍스트 프로토콜을 통해 SQLite 데이터베이스에 저장된 로그 데이터를 쿼리하여 로그 분석과 자연어 상호작용을 가능하게 합니다.
Related Resources
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 -17MIT 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 -3,221204MIT 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