In this work we consider the solution of the time harmonic wave equation in a one dimensional periodic medium with weak random perturbations. More precisely, we study two types of weak perturbations: (1) the case of stationary, ergodic and oscillating coefficients, the typical size of the oscillations being small compared to the wavelength and (2) the case of rare random perturbations of the medium, where each period has a small probability to have its coefficients modified, independently of the other periods. Our goal is to derive an asymptotic approximation of the solution with respect to the small parameter. This can be used in order to construct absorbing boundary conditions for such media.