Getting Data In

Json data processing

xuehpx
New Member

I have a json format of data, I can not use the following method to process the results I want, when metricValue is a new dictionary, I changed how to extract.

xuehpx_0-1628213089777.png

index="huawei_fc" sourcetype="BW_HWFC:metric:host" | rename value{}.* as * | eval t = mvzip(metricId,metricValue) | mvexpand t | eval mId=mvindex(split(t,","),0),mValue=mvindex(split(t,","),1) | stats values(mValue) as mValue by _time,urn,mId

xuehpx_1-1628213321615.png

I was unable to extract the data in metricValue from the SPL above

 

 

 

 

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try a different delimiter in mvzip and split

| eval t = mvzip(metricId,metricValue,"|") | mvexpand t | eval mId=mvindex(split(t,"|"),0),mValue=mvindex(split(t,"|"),1)
0 Karma

xuehpx
New Member
Thank you so much for your advice! I will try according to your suggestion in the near future.
0 Karma
Get Updates on the Splunk Community!

Why You Can't Miss .conf25: Unleashing the Power of Agentic AI with Splunk & Cisco

The Defining Technology Movement of Our Lifetime The advent of agentic AI is arguably the defining technology ...

Deep Dive into Federated Analytics: Unlocking the Full Power of Your Security Data

In today’s complex digital landscape, security teams face increasing pressure to protect sprawling data across ...

Your summer travels continue with new course releases

Summer in the Northern hemisphere is in full swing, and is often a time to travel and explore. If your summer ...