Sayyiduna Mu'adh bin Jabal (may Allah be pleased with him) narrates from the Messenger of Allah (peace and blessings be upon him) that he (peace and blessings be upon him) said: "Fighting (in jihad) is of two kinds. Whoever fights seeking the pleasure of Allah, obeys the Imam, spends his finest wealth, shows kindness to his companion, and avoids corruption in the land, then his sleep and his wakefulness are all good. But whoever fights out of pride, showing off and seeking fame, disobeys the Imam, and spreads corruption in the land, he does not even come back breaking even."
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 17312