Google's preferred way is to use canonical links:
<link rel="canonical" href="http://somedomain.com/myurl123-event" />
This tag function should tell the search engine which URL should be indexed on these pages containing dynamic query parameters.
Read more about them here: Google link
Using them, you donβt have to worry about accidentally blacklisting parts of your site, for example, using robots.txt files and getting into your traffic.
source share