var data = JSON.parse(value),
    consul_api_scheme = '{$CONSUL.API.SCHEME}',
    consul_api_port = '{$CONSUL.API.PORT}',
    result = [];

data.forEach(function(instance) {
    if (instance["ID"] != '') {
      result.push({
      '{#NODE_NAME}': instance["Node"],
      '{#NODE_ADDRESS}': instance["Address"],
      '{#NODE_API_URL}': consul_api_scheme + '://' + instance["Address"] + ':' + consul_api_port,
      '{#NODE_DATACENTER}': instance["Datacenter"]
      });
    }
  });

return JSON.stringify(result)