Sahih Muslim 1904 b
It has been narrated (through another chain of transmitters) on the authority of Abu Musa who said. The Messenger of Allah (ﷺ) was asked which of the men fights in the way of Allah:
(one who fights) for displaying his valour; (a man who) fights out of his family pride and (a man who) fights for the sake of show, who amongst these fights in the way of Allah? The Messenger of Allah (ﷺ) said: Who fights that the word of Allah be exalted fights in the way of Allah.
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَابْنُ، نُمَيْرٍ وَإِسْحَاقُ بْنُ إِبْرَاهِيمَ وَمُحَمَّدُ بْنُ الْعَلاَءِ
 قَالَ إِسْحَاقُ أَخْبَرَنَا وَقَالَ الآخَرُونَ، حَدَّثَنَا أَبُو مُعَاوِيَةَ، عَنِ الأَعْمَشِ، عَنْ شَقِيقٍ، عَنْ أَبِي،
 مُوسَى قَالَ سُئِلَ رَسُولُ اللَّهِ صلى الله عليه وسلم عَنِ الرَّجُلِ يُقَاتِلُ شَجَاعَةً وَيُقَاتِلُ حَمِيَّةً
 وَيُقَاتِلُ رِيَاءً أَىُّ ذَلِكَ فِي سَبِيلِ اللَّهِ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏
"‏ مَنْ قَاتَلَ
 لِتَكُونَ كَلِمَةُ اللَّهِ هِيَ الْعُلْيَا فَهُوَ فِي سَبِيلِ اللَّهِ ‏"‏ ‏.‏