Design an algorithm to efficiently parse and detect anomalies in a massive, real-time stream of application logs at Datadog.