Design a system which can report frequently occurring exceptions on a dashboard

You are given a log file generated from a distributed service in which each line is either a service event or exception.
Design a system which can report frequently occurring exceptions on a dashboard. In below file, most commonly occuring exception is Exception1.

User of the system should be able to fetch results for say top 10 or 50 exceptions. Assume that, a given event as well as exception take only one line in the log file.

event 1
exception 1
exception 2
event 2
exception 3
exception 1
exception 3
exception 1

Entries should be sorted by occurance, most frequent appearing at the top.
Top 2 exceptions for above file would be.

exception 1  
exception 3

Now, what if the operation needs to be performed for a given time range (Assume that each log entry has timestamp as well)?

Comments (3)