How to group log messages

Hello,

I have just started using OpenSearch.
Is there a possibility to group log messages? I am concerned that many messages are mostly identical except for timestamp or ID. To avoid searching through hundreds of duplicate logs, I would like to group them.

If there is a way, where can I find it?

Thanks a lot!