Inventory query with filter for "not equal"

Hello,

I’m trying to get a list of device, that do not have a specific string in the ocnfiguration. i need to negate the eq filter, but it doesn’t seem to work.

This is what I try:
/inventory/managedObjects?query=$filter=not (c8y_Configuration.config eq ‘2.1.126’)

I get an empty list, even though there is a plenty of devices without this in config.

Am I doing something wrong?

Peter

Hi Peter,

If you remove the single quotes from your query it works as intended. If you only want to find device and not any other types of managed objects I would also recommend using the query param ‘q’ instead. This will only return objects that also have c8y_IsDevice.

The final query looks like this then:

/inventory/managedObjects?q=$filter=not (c8y_Configuration.config eq 2.1.126)

This topic was automatically closed after 1083 days. New replies are no longer allowed.