#community-help

Querying Devices by IP Using Prefix Search

TLDR satish asked how best to query devices by IP. Kishore Nallan recommended using a prefix search and indexing as a string.

Powered by Struct AI
Apr 06, 2022 (21 months ago)
satish
Photo of md5-21068ce5c0a7db9d103fad551dbefbc7
satish
04:08 AM
I have a requirement to query devices by Ip, Wondering what is the best way to do. Is that storing the data as a string works ?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
04:09 AM
IP ranges or just pointed lookups?
satish
Photo of md5-21068ce5c0a7db9d103fad551dbefbc7
satish
04:14 AM
Sorry I am not sure on what is pointed look ups . My case the user can enter 10.0.* and I have to get all the devices fall under that category
04:14
satish
04:14 AM
Is IP range query is something like 10.0.0.[0-256]
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
04:18 AM
Prefix search will work for that. So just index as string.
satish
Photo of md5-21068ce5c0a7db9d103fad551dbefbc7
satish
04:28 AM
Thanks. will try that