Splunk Enterprise

parsing out value from multi value field

dtakacssplunk
Explorer

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

Labels (1)
0 Karma

thambisetty
SplunkTrust
SplunkTrust

| rex field=fieldB "k\":(?<fieldb_val>\d+)"

| stats sum(fieldb_val) by fieldA

————————————
If this helps, give a like below.
0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...