var lookup = {},
    result = [];

JSON.parse(value).forEach(function (item) {
    var resource = item.labels.resource;
    if (!(lookup[resource])) {
        lookup[resource] = 1;
        result.push({ '{#RESOURCE}': resource });
    }
});
return JSON.stringify(result);