Language:
كتاب الإيمان
2  
Belief
(12)
Chapter: To flee (run away) from Al-Fitn (afflictions and trials), is a part of religion
(12)
باب مِنَ الدِّينِ الْفِرَارُ مِنَ الْفِتَنِ
Sahih al-Bukhari 19

Narrated Abu Said Al-Khudri:

Allah's Messenger (ﷺ) said, "A time will soon come when the best property of a Muslim will be sheep which he will take on the top of mountains and the places of rainfall (valleys) so as to flee with his religion from afflictions."

حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مَسْلَمَةَ، عَنْ مَالِكٍ، عَنْ عَبْدِ الرَّحْمَنِ بْنِ عَبْدِ اللَّهِ بْنِ عَبْدِ الرَّحْمَنِ بْنِ أَبِي صَعْصَعَةَ، عَنْ أَبِيهِ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ، أَنَّهُ قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ يُوشِكُ أَنْ يَكُونَ خَيْرَ مَالِ الْمُسْلِمِ غَنَمٌ يَتْبَعُ بِهَا شَعَفَ الْجِبَالِ وَمَوَاقِعَ الْقَطْرِ، يَفِرُّ بِدِينِهِ مِنَ الْفِتَنِ ‏"‏‏.‏
Reference : Sahih al-Bukhari 19
In-book reference : Book 2, Hadith 12
USC-MSA web (English) reference : Vol. 1, Book 2, Hadith 19
  (deprecated numbering scheme)