How to make right aggregation by response code

Greetings everyone.
I need community help as im far away from deep ES or Grafana knowledge.
I made setup by following manual:

NGINX produces logs in following manere:

        log_format json_logs '{"@timestamp":"$time_iso8601","host":"$hostname",'
                            '"server_ip":"$server_addr","client_ip":"$remote_addr",'
                            '"xff":"$http_x_forwarded_for","domain":"$host",'
                            '"url":"$uri","referer":"$http_referer",'
                            '"args":"$args","upstreamtime":"$upstream_response_time",'
                            '"responsetime":"$request_time","request_method":"$request_method",'
                            '"status":"$status","size":"$body_bytes_sent",'
                            '"request_body":"$request_body","request_length":"$request_length",'
                            '"protocol":"$server_protocol","upstreamhost":"$upstream_addr",'
                            '"file_dir":"$request_filename","http_user_agent":"$http_user_agent"'
                            '}';

I was taken this dashboard

Everything looks not bad, data going ok to Grafana and showing on Dashboard.
So here is my problems:
I have few backend API points behind NGINX and i need to make a stats for each backend with response code statistics - like for example:

API endpoint on my service /backend/api
200 - 97%,
404 - 1 %,
502 - 2 %

How can i manage such thing? create a pie graph for each api endpoint?
Or maybe other way: bars with multiple data in each bar.

I am not sure about elasticsearch but this is certainly possible using Loki and this popular prepared dashboard:

many also consider this one of the best nginx dashboards: