I have two sets of JSON objects with unique keys in each of them.
First JSON :
{
"Sugar": {
"prod_rate" : "50",
"prod_qual" : "Good"
},
"Rice": {
"prod_rate" : "80",
"prod_qual" : "OK"
},
"Potato": {
"prod_rate" : "87",
"prod_qual" : "OK"
}
}
Second JSON :
{
"Sugar": {
"prod_rate" : "50",
"prod_qual" : "Good"
},
"Wheat": {
"prod_rate" : "60",
"prod_qual" : "Good"
}
}
How can I find the unique keys in any one of JSONs that is not in other and show that in a table.
For example, from the first JSON, the unique key will be "Rice" & "Potato" and the missing key will be "Wheat". I want to make a Splunk table with two columns as unique keys and missing keys to show this data.
Please help, I am new to Splunk.
Thanks
I could do it with below ways considering the datasets in same and different events. Posting each of them below :
--- same event ---
--- two different events with appendcols ----
--- without appendcols (less longer search, optimized) ---
--- This below query works, but it's a complete different representatoin than the above ones ---
Thanks