How to clean & group url with paramater data

I have URL field on my log which i need to group/bucket:
Unfortunately the it has some varying data on it, such as:

how to change it into:

for easier aggregation?

on ELK 7.10 Basic

Hi there,

you could use filters aggregation, available both for Lens and Visualize and create filters in kql like:
url :*
url :*.

Here's a tutorial that does similar things: Build your first dashboard | Kibana Guide [7.13] | Elastic