Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

About

This is a command-line application that parses a log (.txt) file with each line containing a log entry of various categories. It then classifies these logs to their respective categories, performs aggregations based on the log category and saves the aggregations in JSON files.
The current logs are of one of these types:

APM Logs (Application Performance Metrics) Application Logs Request Logs
eg timestamp=2024-02-24T16:22:15Z metric=cpu_usage_percent host=webserver1 value=72 timestamp=2024-02-24T16:22:20Z level=INFO message="Scheduled maintenance starting" host=webserver1 timestamp=2024-02-24T16:22:25Z request_method=POST request_url="/api/update" response_status=202 response_time_ms=200 host=webserver1
keys - metric = cpu_usage_percent, memory_usage_percent, disk_usage_percent etc
- value will have the respective value
- level can be INFO, ERROR, DEBUG, WARNING - request_url can be /api/update, /api/status, /api/retry etc
- response_time_ms has the response time for the API route
-response_status has the response status for the API route
find for each metric:
- minimum
- median
- average
- max
for each level:
- count
for each route:
- min of response_time
- 50_percentile of response_time
- 90_percentile of response_time
- 95_percentile of response_time
- 99_percentile of response_time
- max of response_time
- count of response_status
file apm.json application.json request.json

Notes

  1. To run the program, use the command ./LogParser.sh --file <filename.txt> from the LogParser root directory (might have to run chmod +x LogParser.sh once to give it permission to run)
  2. The parser ignores a log entry in case it is corrupted or incomplete
  3. Output files are created even if no entry exists for that type
  4. Part I.pdf contains the solutions for the first question along with the class diagram
  5. LogParser is the solution for the second question - Java code and JUnit unit tests

Class Diagram

Individual Project - Log Parser - Class Diagram


Review Assignment Due Date

About

CLI tool that classifies high-throughput log entries by category and aggregates them to JSON, at 100% test coverage

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages