try{
  parsed = JSON.parse(value);
  var result = [];

  function getNodes(nodes) {
      Object.keys(nodes).forEach(function (field) {
          var Node = {};
          Node['{#HOSTNAME}'] = field || '';
          Node['{#INFOADDR}'] = nodes[field].infoAddr || '';
          result.push(Node);
      });
  }

  getNodes(JSON.parse(parsed.beans[0].LiveNodes));
  getNodes(JSON.parse(parsed.beans[0].DeadNodes));
  getNodes(JSON.parse(parsed.beans[0].DecomNodes));
  getNodes(JSON.parse(parsed.beans[0].EnteringMaintenanceNodes));

  return JSON.stringify(result);
}
catch (error) {
  throw 'Failed to process response received from Hadoop.';
}
