Umar bin Khattab set out for Sham. When he reached Sargh, news came to him that a plague had broken out in Sham. Abdul-Rahman bin Awf then informed him that the Messenger of Allah ﷺ had said, "When you hear of it in a land, do not approach it, and when it breaks out in a land where you already are, do not leave fleeing from it."So Umar turned back from Sargh.
أن عمر بن الخطاب خرج إلى الشام، فلما جاء سرغ بلغه أن الوباء قد وقع بالشام، فأخبره عبد الرحمن بن عوف، أن رسول الله ﷺ قال: إذا سمعتم به بأرض فلا تقدموا عليه، وإذا وقع بأرض وأنتم بها فلا تخرجوا فرارا منه فرجع عمر من سرغ.
Malik reported it in Kitab al-Jami (24), from Ibn Shihab, from Abdullah bin Amir bin Rabia, and he mentioned it.Bukhari reported it in al-Tibb (5730), and Muslim in al-Salam (2219:100), both of them through the route of Malik, with the same wording.