This is Steve Gadd's opening funk-Afro 12/8 groove from Al Di Meola's epically absurd fusion opus Casino, from the album of the same name:
Listen to the recording and note the different qualities of accent— the first one is a fat backbeat, and the second one is a rim shot, played closer to the edge of the drum.
Here's the entire intro, with that ending lick:
I feel like people have issues with rhythm in */8 meters, so just understand that the underlying rhythm on the lick is quarter notes— which, in 12/8, are equivalent to quarter note triplets in 4/4. Check out Grady Tate doing a similar thing in a different context.
If you want to develop this feel further, here's an old Page o' Coordination (due for an update) for working through some bass drum variations.