הַחֶ֣רֶב בַּח֔וּץ וְהַדֶּ֥בֶר וְהָרָעָ֖ב מִבָּ֑יִת אֲשֶׁ֤ר בַּשָּׂדֶה֙ בַּחֶ֣רֶב יָמ֔וּת וַאֲשֶׁ֣ר בָּעִ֔יר רָעָ֥ב וָדֶ֖בֶר יֹאכֲלֶֽנּוּ׃
The sword is without, and the pestilence and the famine within; he that is in the field shall die with the sword, and he that is in the city, famine and pestilence shall devour him.
Sifrei Devarim
(Ibid. 25) "On the outside (of the city) the sword (of legions) shall devour (them) "— whence they derived: "In time of war, 'gather in' your legs" (i.e., stay at home); "in time of famine, 'spread out' your legs (and leave)." And thus is it written (Jeremiah 19:18) "If I go out to the field, there are the slain of the sword! And if I enter the city, there are the sick with famine!" And (Ezekiel 7:15) "Whoever is in the field will die by the sword, and whoever is in the city, famine and plague will consume him."