var bgp_peers = JSON.parse(value),
	result = [];

if (bgp_peers.response.result && bgp_peers.response.result.entry) {
	var peers = Array.isArray(bgp_peers.response.result.entry) ? bgp_peers.response.result.entry : [bgp_peers.response.result.entry];

	result = peers.map(function (peer) {
		return {
			'{#PEER}': peer['@peer'],
			'{#PEERGROUP}': peer['peer-group'],
			'{#PEERADDR}': peer['peer-address'].replace(/:\d+$/, '')
		}
	});

	return JSON.stringify(result);
}

return JSON.stringify(result);