def handle(self, key, value):
        # break down key
        elements = key.split(":")

        stats = elements[1]
        appid = elements[2]
        uuid = value

        # log we received the stats request
        extras = self.get_log_dict('stats', appid, uuid=uuid)
        self.logger.info('Received {s} stats request'.format(s=stats),
            extra=extras)

        extras = {}
        if stats == 'all':
            extras = self.get_all_stats()
        elif stats == 'kafka-monitor':
            extras = self.get_kafka_monitor_stats()
        elif stats == 'redis-monitor':
            extras = self.get_redis_monitor_stats()
        elif stats == 'crawler':
            extras = self.get_crawler_stats()
        elif stats == 'spider':
            extras = self.get_spider_stats()
        elif stats == 'machine':
            extras = self.get_machine_stats()
        else:
            self.logger.warn('Received invalid stats request: {s}'\
                .format(s=stats),
            extra=extras)
            return

        extras['stats'] = stats
        extras['appid'] = appid
        extras['uuid'] = uuid
        extras['server_time'] = int(self.get_current_time())

        if self._send_to_kafka(extras):
            extras['success'] = True
            self.logger.info('Sent stats to kafka', extra=extras)
        else:
            extras['success'] = False
            self.logger.error('Failed to send stats to kafka', extra=extras)
Parse an authorization decision query
dataset/ETHPy150Open istresearch/scrapy-cluster/redis-monitor/plugins/stats_monitor.py/StatsMonitor.handle--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pysaml2-2.4.0/src/saml2/server.py/Server.parse_authz_decision_query