Hi all, I have a sample json file like this.
{
"Project Name" : "abc",
"Project Group":"A",
"Unit":"B",
"groups_data":[{
"a":"32.064453125",
"b":"5.451171875",
"c":"0.3349609375",
"d":"0.1...
See more...
Hi all, I have a sample json file like this.
{
"Project Name" : "abc",
"Project Group":"A",
"Unit":"B",
"groups_data":[{
"a":"32.064453125",
"b":"5.451171875",
"c":"0.3349609375",
"d":"0.181640625",
"e":"4.58203125",
"f":"81.1611328125"}]
}
I want to plot a pie chart for the key value pairs present in the groups_data. I tried extracting the data using this query.
myindex sourcetype="_json"| rex field=_raw "\"group_data\":\[\{\"(?<component>[^/]*)\":"\"(?<Value>\d+)\"\}\]| eval tmp = mvzip(component,Value) |mvexpand tmp |eval component=mvindex(split(tmp,","),0) |eval Value=mvindex(split(tmp,","),1)|chart values(Value) by component
I am not able to pie chart. It says tmp does not exist.Can anyone tell me is there anything wrong in the regex part? Something i missed anywhere?