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

**URL:** <https://community.dynatrace.com/t/need-a-help-to-fetch-log-based-on-the-condition-from-json/50267>\
**Category:** DQL\
**Tags:** logs\
**Created:** [February 14, 2025, 11:21am UTC](https://community.dynatrace.com/t/need-a-help-to-fetch-log-based-on-the-condition-from-json/50267 "2025-02-14T11:21:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JanJanu](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@JanJanu](https://community.dynatrace.com/u/JanJanu)\
**Post date:** [February 14, 2025, 11:21am UTC](https://community.dynatrace.com/t/need-a-help-to-fetch-log-based-on-the-condition-from-json/50267/1 "2025-02-14T11:21:32Z")

</div>

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”,

}  
}  
}

---

<div class="post-metadata">

**Author:** ![JeanBlanc](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jeanblanc/32/25897_2.png) [@JeanBlanc](https://community.dynatrace.com/u/JeanBlanc)\
**Post date:** [February 17, 2025, 3:16pm UTC](https://community.dynatrace.com/t/need-a-help-to-fetch-log-based-on-the-condition-from-json/50267/2 "2025-02-17T15:16:34Z")

</div>

**Hi,**

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

```markup
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"

```
