The reigning Bundesliga champions had scored 14 goals in their previous two league outings, and they looked in the mood for another heavy win on Friday as they went 2-0 up inside 10 minutes courtesy of Bastian Schweinsteiger and Franck Ribery.
However, Cologne pulled one back on the stroke of half-time through Anthony Ujah, and the striker would have levelled after the interval had it not been for a fine stop from Manuel Neuer, who also kept out Marcel Risse from the resulting corner.
Those saves proved to be crucial, as Arjen Robben and Robert Lewandowski completed another routine win to move Bayern 11 points clear at the summit of the Bundesliga.
"I'm happy. We beat the side with the second best record away from and scored four goals," Guardiola said.
"Manuel Neuer made two great saves at key moments. They are a very, very, very difficult opponent. We started well. Then we lost a bit of control.
"After the 3-1 goal by Arjen it was a completely different game again. We dominated again."
Bayern sporting director Matthias Sammer echoed the sentiments of Guardiola.
"We were very impressive in the first 25 minutes," he said.
"You have to pay compliments to Cologne. The fact that we almost went 2-2 must not happen to us.
"They have played to their strengths, but we are pleased that we won."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.