An awesome README template to jumpstart your projects!
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
Log Data Retrieval is a comprehensive web-based application designed to simplify the retrieval and analysis of log data. The project includes features for searching, filtering, and visualizing log entries, making it an invaluable tool for managing large sets of log data.
Key Features:
Search Functionality: Easily search for log entries based on various criteria such as level, message, timestamp, resource ID, and more.
Date Range Filtering: Retrieve log entries within a specific date range to focus on relevant data.
Flexible Search Fields: Choose from a variety of search fields, including level, message, resource ID, timestamp, trace ID, span ID, commit, and parent resource ID.
JSON Parsing and Database Storage: Efficiently parse JSON files, store the log data in a MySQL database, and enable seamless retrieval.
Visualize Data: View log data in a structured tabular format on the website, providing a user-friendly interface for analysis.
Dyte_Project_video.4.mp4
- Django
- HTML & CSS
- Javascript
- Python
- MySQL
The Log Ingestor is a component of this project responsible for collecting and storing log entries. It allows you to search and filter logs based on various criteria.
Make sure you have the following installed:
- Python (Version 3.10 or above)
- Django
- MySQL (Version 8.0 or above)
Clone the repository:
git clone https://github.com/abinetha/Dyte_Project.git
Navigate to the project directory:
cd Dyte_Project
Create a virtual environment:
python -m venv venv
Activate the virtual environment:
On Windows:
.\venv\Scripts\activate
On macOS/Linux:
source venv/bin/activate
Install dependencies:
pip install -r requirements.txt
Run migrations:
python manage.py migrate
Start the development server:
python manage.py runserver
The project should now be running locally. Access the admin panel at http://127.0.0.1:3000/admin/ and log in with the superuser credentials.
1. Viewing Logs
Description: The Log Viewer allows you to easily view logs through a web-based interface.
Steps:
- Open your web browser and navigate to the Log Viewer website (http://localhost:3000/).
- The main page displays log entries in a tabular format.
- Logs are automatically loaded from the database and updated periodically.
2. Searching Logs
Description: Use the search functionality to filter logs based on specific criteria.
Steps:
- On the main page, locate the search form.
- Choose a search field from the dropdown menu (e.g., Level, Message, Timestamp).
- Enter the search text in the designated input field.
- Optionally, specify a start and end date for a date range search.
- Click the "Search" button.
- The table will update to display logs that match the specified criteria.
3. Adding Logs
Description: Use the /save_json_data/
endpoint to add logs to the system.
Steps:
- Make sure to include the json_file_path in the \json_viewer_project\json_viewer\views.py the json file in which you are adding data in the given format.
- Make a POST request to http://localhost:3000/save_json_data/ with your JSON log data.
- The system will respond with a success message if the data is saved successfully.
- If a duplicate entry is detected, a message indicating the duplication will be returned.
- In case of an error, an appropriate error message will be provided.
Example using cURL:
curl -X POST -H "Content-Type: application/json" -d '{"level": "info", "message": "Log entry content", "timestamp": "2023-11-18T12:00:00Z"}' http://localhost:3000/save_json_data/
4. Examples
Filter Logs:
To view all logs, simply navigate to the main page of the Log Viewer. Searching for Errors:
Select "Level" from the "Search Field" dropdown. Enter "error" in the "Search Text" input. Click "Search" to see logs with the "error" level.
Date Range Search:
Enter a start date and end date in the respective input fields. Click "Search" to see logs within the specified date range.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". If you encounter issues, have suggestions, or would like to contribute to the project, feel free to open issues, submit pull requests, or provide feedback. Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!