Exercise 2 : Analysis of Server Logs Problem Statement : • Check logs in the Logs.csv file and find the uptime of each host Solution Abstract :
- Separate the log entries into instances where the server was running fine and not working fine.
- Compare the time difference between these instances to find the maximum uptime of host. Tools/Packages Used: • Datetime • Numpy • Pandas Result :
- Successfully read the log files.
- Converted the log_time to dateTime format for further processing.
- Sorted the data based on log_time.
- Grouped the data based on ‘host’ so that the maximum uptime for each host can be calculated.
- Created two dataframes, one for the instances when the server was up and running and another when it was not up and running.
- Calculated the difference in log_time between these two dataframes to get the uptime for the host.
- The highest value from this is taken as the maximum uptime for the host.
- Refer appendix for final results Future Scope :
- We can predict future failures provided we have data on network traffic, server load, performance matrix etc.