كتاب صلاة المسافرين وقصرها
6  
The Book of Prayer - Travellers
(10)
Chapter: What to say when entering the masjid
(10)
باب مَا يَقُولُ إِذَا دَخَلَ الْمَسْجِدَ ‏‏
Sahih Muslim 713 b

A hadith like this has been narrated from the Messenger of Allah (ﷺ) by Abu Usaid.

Reference : Sahih Muslim 713b
In-book reference : Book 6, Hadith 83
USC-MSA web (English) reference : Book 4, Hadith 1539
  (deprecated numbering scheme)