'Return the stats object for a specific item in JSON format.
Stats should be a list of dict (processlist, network...)'

def get_stats_item(self, item):

    if isinstance(self.stats, dict):
        try:
            return self._json_dumps({item: self.stats[item]})
        except KeyError as e:
            logger.error('Cannot    get    item    {}    ({})'.format(item, e))
            return None
    elif isinstance(self.stats, list):
        try:
            return self._json_dumps({item: map(itemgetter(item), self.stats)})
        except (KeyError, ValueError) as e:
            logger.error('Cannot    get    item    {}    ({})'.format(item, e))
            return None
    else:
        return None
