In this paper we propose a solution to the problems of detecting a generally correlated stochastic output delay sequence of a linear system driven by Gaussian noise. This is the model for uncertain observations resulting from losses in the propagation channel due to fading phenomena or packet dropouts that is common in wireless sensor networks, networked control systems, or remote sensing applications. The solution we propose consists of a nonlinear detector which identifies online the stochastic delay sequence. The solution provided is optimal in the sense that minimizes the probability of error of the delay detector. Finally, a filtering stage fed with the information given by the detector can follow to estimate the state of the system. Numerical simulations show good performance of the proposed method.