Skip to content

A FastAPI-based application that allows users to upload .txt log files and retrieve the last n lines. It features robust error handling and is ideal for log analysis tasks.

Notifications You must be signed in to change notification settings

seemachhunga/log_file_processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Log File Processor API

This project is a FastAPI-based application that enables users to upload .txt log files and retrieve the last n lines from the file. It is designed for efficient log analysis and includes robust error handling to ensure seamless functionality.


Getting Started

Prerequisites

Ensure the following are installed on your system:

  • Python 3.7 or higher
  • pip (Python package manager)

1. Clone the Repository

To begin, clone the repository to your local machine:

git clone https://github.com/seemachhunga/log_file_processor.git
cd log_file_processor

2. Set Up the Virtual Environment
It is recommended to create a virtual environment to manage dependencies:
python -m venv env
.\env\Scripts\activate

3. Install Dependencies
Install the required Python packages using:
pip install -r requirements.txt

4. Run the Application
Start the application using Uvicorn:
uvicorn app:app --reload

The application will run locally at:
API Documentation: http://127.0.0.1:8000/docs
Root Endpoint: http://127.0.0.1:8000/

log_file_processor/
├── app.py             # Main application file
├── requirements.txt   # List of dependencies
├── README.md          # Documentation
└── uploads/           # Directory for uploaded files

Key Notes
Only .txt files are supported for upload.
Use the interactive API documentation available at http://127.0.0.1:8000/docs for testing and exploring the endpoints.

About

A FastAPI-based application that allows users to upload .txt log files and retrieve the last n lines. It features robust error handling and is ideal for log analysis tasks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages