Show log file entries aggregated by regex with count

I have working monitoring of error messages from Nginx access log from zabbix data source. Messages are shown in table panel and there are many similar entries. I want to show messages aggregated by regex with count and show details with complete messages on click at aggregated entry.

Composing regex is not a problem. I want to keep request type, request link without parameters and return code. But how can i collapse all messages matched by regex on selected time period and count them?

Is it possible to do something like this?