cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DQL Parsing nested JSON that has multiple key vale pair having same name

ash2
Frequent Guest

Hi Team,

Could you please guide me on extracting the value that matches the key "LocalAccountUsername" that is I want "abcd@gmail.com" from the JSON provided (highlighted in Red) using DQL Log Processing Rule:

{

"somekey" : "somevalue",

"AdditionalDetails": [
    {
      "key": "A1",
      "value": "a1"
    },
    {
      "key": "B1",
      "value": "b1"
    },
    {
      "key": "C1",
      "value": "c1"
    },
    {
      "key": "D1",
      "value": "xxx"
    },
    {
      "key": "LocalAccountUsername",
      "value": "abcd@gmail.com"                                                
    },
    {
      "key": "E1",
      "value": "xxx"
    },
    {
      "key": "F1",
      "value": "f1"
    }
  ],
somekey1:somevalue1
}
 
 
 
2 REPLIES 2

dannemca
DynaMight Guru
DynaMight Guru

You will need to know the exactly position to extract it.

In your example it is on position 4 . [0,1,2,3,4,5...]

so the field will be:

AdditionalDetails.4.key

AdditionalDetails.4.value

 

Site Reliability Engineer @ Kyndryl

ash2
Frequent Guest

Thanks @dannemca , could you please share with me the complete query?

Featured Posts