Forum Discussion
6 years ago
Thanks for this, this is great.
I am only interested in the ip and org info so in the interest of de-cluttering the property source info I reduced the script output to just that. Stack Exchange (since I'm not a groovy guy) pointed me to this solution.
//comment out orig map iteration
//arrayInfo_map.each{ key, value -> println "$key=$value"};
def ip_addr = arrayInfo_map.find{ it.key == "ip" }?.value;
if(ip_addr)
println "ip = ${ip_addr}";
def carrier = arrayInfo_map.find{ it.key == "org" }?.value;
if(carrier)
println "org = ${carrier}";
I wouldn't be surprised if improvement on this is possible.
Thanks again.
Related Content
- 11 months ago