Creating a new tag based on field value

I am using a kafka consumer which is having the json data like this -

counters":{“0”:{“A”:{“B”:“188805”}}}; where 0 is variable and can have value 0/1/2/3

so in influxdb it will go like counters_0_A_B. Now i wanted to create a new tag called cell based on value in the data. Eg - for counters_0 , cell number will be 0, for counters_1 cell number will be 1. Now i know that enum can be used for this, but for that i need to extract cell number from data. So i wanted solution regarding that only.
Also should i stick to telegraf only for this, or any other client can be used like Python.