You can do it like this runnable example with your data - using from the rex statement | makeresults
| eval _raw="Group Value Data
{'a':'1','b':'2'} {'a',...
See more...
You can do it like this runnable example with your data - using from the rex statement | makeresults
| eval _raw="Group Value Data
{'a':'1','b':'2'} {'a','b'}
{'a':1,'b':'2'} {'a'} {'b'}
{'a':1,'b':'2','c':'3'} {'a'} {'b','c'}"
| multikv forceheader=1
| table Group Value Data
``` This is your Splunk SPL ```
| rex field=Group max_match=0 "'(?<g>\w)':"
| rex field=Value max_match=0 "'(?<v>\w)'"
| eval Calculated_Data=mvmap(g, if(g!=v, g, null()))
| eval Calculated_Data="{'".mvjoin(Calculated_Data, "','")."'}"
| fields - g v So, if you have a CSV file with Group and Value in it, then | inputlookup your_csv.csv
| rex field=Group max_match=0 "'(?<g>\w)':"
| rex field=Value max_match=0 "'(?<v>\w)'"
| eval Data=mvmap(g, if(g!=v, g, null()))
| eval Data="{'".mvjoin(Data, "','")."'}"
| fields - g v