How to add filters to API call for SDT devices
Hello -
I am able to fetch SDT devices by calling REST API https://abc.logicmonitor.com/santaba/rest/sdt/sdts?filter=type:DeviceSDT
How do I add additional filters based on system property ( Operating system) and Custom property (Region). Not able to filter results using below.
Sammy
Posted 4 years ago·Last reply 4 years ago
3 comments
Sammy
OP4 years agoThank you for the detailed explanation.
I tried to fetch the required values in response so I can filter based on that. But only the first 3 fields are appearing in result. Is there a way to get the required system & custom properties in response?
{{url}}/sdt/sdts?filter=type:DeviceSDT&fields=deviceDisplayName,admin,timezone,system.collectorplatform,customProperties
LM User
·4 years agoFiltering on properties is tricky. You can filter by the name of the property and by the value of the property, but the name and value in these cases don't have to belong to the same property.
Example properties:
Device A: firstName: Santa, lastName: Claus, enemy: Frost
Device B: firstName: Jack, lastName: Frost, enemy: Claus
A filter of customProperties.name:firstName,customProperties.value:Claus would return both device A and device B because device A has a property called "firstName". It also has a property with a value of "Claus". The problem is that device B also has a property called "firstName" and it also has a property with a value of "Claus".
I normally only use simple filters in the API call. I do the more complex filtering after fetching the data.