Just set up an IRC log bot to log all channel traffic to a web site (can't be bothered to look one up; but I know they existed when I last messed with IRC 20 years ago).
How you search the created logfiles is up to you, znc is not a log management system, it merely creates.