Embodiments of the present disclosure provide a method and apparatus for classifying a failure. The method comprises obtaining a log associated with a failure and identifying a key event in the log, and the key event indicates a predetermined situation. The method further comprises determining a similarity between the failure and each of a set of historical failures based on the key event, and the set of historical failures have been classified into at least one category. The method further comprises classifying the failure based at least partly on the similarity. Embodiments of the present disclosure enable classifying the failure fast and accurately by determining the similarity associated with key event between failures.