my %ams_ips_hash = map { $_->{'deviceIp'} => 1 } @{$ams_hosts};