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",'

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: