# Dynamicly finding a disk

**URL:** <https://forum.ansible.com/t/dynamicly-finding-a-disk/29610>\
**Category:** Ansible Project\
**Created:** [February 4, 2019, 2:58pm UTC](https://forum.ansible.com/t/dynamicly-finding-a-disk/29610 "2019-02-04T14:58:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keif\_Gwinn1](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@Keif\_Gwinn1](https://forum.ansible.com/u/Keif_Gwinn1)\
**Post date:** [February 4, 2019, 2:58pm UTC](https://forum.ansible.com/t/dynamicly-finding-a-disk/29610/1 "2019-02-04T14:58:06Z")

</div>

Hi,

I’m trying to dynamically identify a disk based on the device Ids

{“ids”: {  
“sda”: [“google-persistent-disk-0”, “scsi-0Google\_PersistentDisk\_persistent-disk-0”],  
“sda1”: [“google-persistent-disk-0-part1”,“scsi-0Google\_PersistentDisk\_persistent-disk-0-part1”],  
“sdb”: [“google-mongodb”,“scsi-0Google\_PersistentDisk\_mongodb”]  
}  
}

I can’t seem to work out how to set up a jmespath query to pull back sdb from searching for ‘mongobd’. It might not be possible.

Any suggestions? Is this the right approach?
