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

Need a help to fetch log based on the condition from json

JanJanu
Newcomer

this is the sample json format need DQL to fetch logs if imported is 11 based on the ID

{
"ID": {
"ID": "ghghgghgh",
"Type": "jj"
},
"Fruits": {
"Character": {
"color":"red"
"taste": bitter,

},
"Types": {
"imported": [
11
],
"isavailable": "False",

}
}
}

1 REPLY 1

JeanBlanc
Contributor

 

Hi,

I'm not sure I fully understand, but you can automatically parse JSON and then filter it like this:

data json:"""{
    "ID": {
        "ID": "ghghgghgh",
        "Type": "jj"
    },
    "Fruits": {
        "Character": {
            "color": "red",
            "taste": "bitter"
        },
        "Types": {
            "imported": ["11"],
            "isavailable": "False"
        }
    }
},"""
| parse Fruits[Types][imported][0], "INT:event"
| filter Fruits[Types][imported][0] == "11"

 

 

Featured Posts