Off hand, the only novel I can think of is Starship Troopers. Though, fair warning, the politics might not sit well with you. If that’s the case, the Paul Verhoeven adaptation’s subversion of the novel might be more comfortable.
In this case history is your friend. Or at least, the kind of friend who drags you into horrible places and watches you squirm for their own amusement.
Nearly every European military included lashing as a punishment at one time or another. So, the Horatio Hornblower, Sharpe and Master and Commander novels might include lashings. I’d be genuinely surprised if none of them do, but I haven’t actually read most of them.
Finally, a lot of books dealing with slavery will include it.
Sorry, I can’t offer a more concrete list. It’s not something I usually dwell on.