Bacterial flagellar synthesis is a complex process that requires coordinated expressions of three classes of genes. Recent single cell experiments in E. coli showed that flagellar class-2 promoters are activated in stochastic pulses instead of following a deterministic program as suggested by previous population measurements. Here, by using a stochastic model to quantitatively analyze these single-cell expression data, we identify two main factors that are responsible for the stochastic pulsating expression of class-2 genes. First, YdiV, an inhibitor of the master regulator Fl-hDC (a class-1 protein complex), creates a steep response function that filters out the small FlhDC fluctuations, and the filtered signal approximates a digital random telegraph signal. Second, the timescale (τ 2 ) governing the class-2 activity dynamics is longer than that of FlhDC fluctuations (τ 1 ), which indicates an integration effect wherein class-2 activity depends on previous FlhDC levels within a time-window τ 2 . Together, our results suggest that the noisy FlhDC input signal is first filtered with a threshold set by YdiV and then integrated over the long timescale τ 2 to yield the intermittent transcriptional pulses observed in E. coli flagellar synthesis. This filter-and-integrate strategy allows E. coli to avoid prematurely starting the expensive class-2 gene expression by small or large-but-short FlhDC fluctuations. Possible molecular mechanisms for the filter-and-integrate strategy are proposed. Our model is also used to make testable predictions on responses to realistic time-dependent stimuli. Finally, a comparison with a different gene regulation strategy enabled by an additional positive feedback loop in Salmonella is discussed.