Dave_Lee
2 years agoAdvisor
API Filtering
Hi all
I’m hoping someone might be able to steer me in the right direction!
I’m trying to put together a filter to pull back devices that have:
- system.azure.tag.environment = production
- system.azure.tag.environment = prod
- or have no system.azure.tag.environment at all
I’ve put this together so far:
systemProperties:"{\"name\":\"system.azure.tag.environment\",\"value\":\"Production\"}"|
"{\"name\":\"system.azure.tag.environment\",\"value\":\"Prod\"}"|
"{\"name\":\"system.azure.tag.environment\",\"value\":::empty}"
Which is accepted but it only pulls back devices where environment=Production or Prod. I think the issues with :::empty is that it only works if the system property system.azure.tag.environment exists, which it won’t if it’s not set to anything.
I was hoping I might be able to do something like this, but this isn’t accepted….
systemProperties:"{\"name\":\"system.azure.tag.environment\",\"value\":\"Production\"}"|
"{\"name\":\"system.azure.tag.environment\",\"value\":\"Prod\"}" ||
systemProperties!~"{\"name\":\"system.azure.tag.environment\",\"value\":\"*\"}"
Any ideas?