Counting comma separated list lines

I have loki log lines like “Something [1, 2, 3, 10, 200, 500]” and I would like to count number of elements in this single line (in this case 6), and then sum those values for each line on 1 minute basis.

Seems like a simple task, but I cannot find easy solution.

Hey could you tell me which helm image you use for all these setup like grafana , loki etc . And how you make sure grafana data not lost even if pod deleted .