lordmilko / PrtgAPI

C#/PowerShell interface for PRTG Network Monitor
MIT License
301 stars 37 forks source link

Filtering by notcontains or wildcarding notequal #25

Closed SamuelmAsh closed 6 years ago

SamuelmAsh commented 6 years ago

Hi lordmilko, do you have any plans to include doesnotcontain as a filtering method or can you think of a way to select all devices which do not contain RTR in the name?

lordmilko commented 6 years ago

PrtgAPI implements all known filter operators supported by PRTG:

Are you saying PRTG supports a "doesnotcontain" operator, i.e. filter_prop=@doesnotcontain(val)?

Otherwise, you will need to perform your filtering client side using the facilities of the language being used to generate the API request

In PowerShell, you would retrieve all devices whose name does not contain "rtr" as follows:

Get-Device | where name -notlike *rtr*
SamuelmAsh commented 6 years ago

Was not aware of | where name -notlike apologies. I'll stop hounding you with beginner PS questions now :)