Joe Tran 23 Report post Posted January 19, 2018 I've setup a few custom properties that define if an Oracle database exists and the port it listens on in a key-value pair/JSON syntax. These properties are named in <ApplicationName>.databases format (e.g. app1.databases & app2.databases). Not wanting to repeat myself, I have a set of datasources that query the common Oracle datapoints, but I would like a way to combine all of these *.databases properties together without having to constantly update the datasources or a propertysource whenever I have a new application to monitor. It would be nice to have a method in the hostProps class that supports getting device properties using a wildcard, glob, or regular expression. Quote Share this post Link to post Share on other sites
Brandon 32 Report post Posted May 25, 2018 Hey Joe, I'm not sure that this exactly meets your needs, but I think it's a good start. Basically, you can call hostProps.toProperties() method which spits out an array that you can now dig through and filter using regex. Something like this: def allProps = hostProps.toProperties() allProps.each{ if(it ==~ /.*\.databases=/){ println it } } Let me know if this doesn't address what you're trying to accomplish. 2 Quote Share this post Link to post Share on other sites
Joe Tran 23 Report post Posted May 29, 2018 Hi @Brandon, It actually does! I was not aware of the toProperties() method. Thank you! Quote Share this post Link to post Share on other sites