I have data in the following form:
field A, field B(this is an array)
a {"k":1}
{"k":2}
{"k":3}
b {"k":1}
{"k":1}
{"k":1}
field B is an array, I want to produce table like this
field A, sumB
a 6
b 3
what is the way to extract the values and add them up?
my thinking was to do
| eval value=spath(fieldB, "k")
and I was expecting values to have array 1,2,3 and 1,1,1 but they did not
| rex field=fieldB "k\":(?<fieldb_val>\d+)"
| stats sum(fieldb_val) by fieldA