Creating a drill down graph from a parent graph

HI i have created a stacked bar graph for my loki data source. i have used the pattern format operation to parse the data. Here is the query

{job="apache-logs"} != `server-status` | pattern `<datetime> | <response> | <duration> ms | <bytes> B | <_> | <_> | <_> | <_> | "<_> <_>/<service>/<url> <_>"` 

query 2

sum by(service) (sum_over_time({job="apache-logs"} != `server-status` | pattern `<datetime> | <response> | <duration> ms | <bytes> B | <_> | <_> | <_> | <_> | "<_> <_>/<service>/<url> <_>"` | unwrap bytes | __error__=`` [$__interval]))

I have used the datetime on x axis and every service displays a different color. Now based on the bar i select i want the service and time to be picked up and filter data in the table on the child dashboard. I read in many documents that i need to create variables. but i am not able to do it.
Can i get a detailed explanation on how can i create variable for the service and time selected and then pass it on to the child dashboard for filtering?