A funeral procession passed by, and the Prophet ﷺ stood up for it, and we stood with him.We said, "Messenger of Allah, it is a Jewish funeral."He replied, "Death is a fearsome thing. When you see a funeral procession, stand up."
مرت جنازة فقام لها النبي ﷺ وقمنا معه، فقلنا: يا رسول الله! إنها يهودية، فقال: إن الموت فزع فإذا رأيتم الجنازة فقوموا.
Muslim narrated it in his chapter on funerals (960) through several routes from Ismail bin Ulaya, from Hisham Dastawai, from Yahya bin Abu Kathir, from Ubaydullah bin Miqsam, from Jabir bin Abdullah, and he related it as mentioned. The wording is that of Muslim.As for Bukhari, he narrated it in his chapter on funerals (1311) from Muaz bin Fadala, who said, Hisham narrated to us with his chain, but he did not mention in it "death is a fright." However, Bayhaqi narrated it through the route of Abu Qilaba Raqashi, from Muaz bin Fadala, the teacher of Bukhari, and he mentioned in it the addition referred to.So either Bukhari abridged the hadith, or this is how he heard it from his teacher, without the addition. Perhaps his teacher narrated it once as Bukhari heard it, and another time with the addition, which Abu Qilaba then narrated from him.Muslim also narrated it through another route, from Abu Zubayr, who heard Jabir say, The Prophet ﷺ and his companions stood up for the funeral of a Jew until it disappeared from sight.