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!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...