var raw = JSON.parse(value),
	body = raw.body,
	exist_key = [],
	result = [];

function getField(data, path) {
	var steps = path.split('.');
	for (var i = 0; i < steps.length; i++) {
		var step = steps[i];
		if (typeof data !== 'object' || typeof data[step] === 'undefined') {
			throw 'Required field "' + path + '" is not present in data received.';
		}
		data = data[step];
	}
	return data;
}

for (i in body) {
	var uniq_element = true;

	for (key in exist_key) {
		if ((exist_key[key].JobID == getField(body[i], 'JobID')) &&
			(exist_key[key].TaskGroup == getField(body[i], 'TaskGroup')) &&
			(exist_key[key].Namespace == getField(body[i], 'Namespace'))) {
			uniq_element = false;
		}
	}

	if (uniq_element) {
		exist_key.push({ 'JobID': body[i].JobID, 'TaskGroup': body[i].TaskGroup, 'Namespace': body[i].Namespace });
		result.push(body[i]);
	}
}

return JSON.stringify(result);