كتاب الإمارة
33
The Book on Government
(46)
Chapter: It is recommended to seek Martyrdom in the Cause of Allah, Exalted is He.
(46)
باب اسْتِحْبَابِ طَلَبِ الشَّهَادَةِ فِي سَبِيلِ اللَّهِ تَعَالَى ‏‏
Sahih Muslim 1908

It has been narrated on the authority of Anas b. Malik that the Messenger of Allah (may peace he upon him) said:

Who seeks martyrdom with sincerity shall get its reward, though he may not achieve it.
حَدَّثَنَا شَيْبَانُ بْنُ فَرُّوخَ، حَدَّثَنَا حَمَّادُ بْنُ سَلَمَةَ، حَدَّثَنَا ثَابِتٌ، عَنْ أَنَسِ بْنِ مَالِكٍ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏ "‏ مَنْ طَلَبَ الشَّهَادَةَ صَادِقًا أُعْطِيَهَا وَلَوْ لَمْ تُصِبْهُ ‏"‏ ‏.‏
Reference : Sahih Muslim 1908
In-book reference : Book 33, Hadith 224
USC-MSA web (English) reference : Book 20, Hadith 4694
  (deprecated numbering scheme)