def _get_hook_handler(self, alert_body, hook_headers):
        if not alert_body:
            return None
        try:
            if 'Server' in alert_body.get('targets')[0].get('type'):
                return self._server_hook_handler
            elif 'Application' in alert_body.get('targets')[0].get('type'):
                return self._app_hook_handler

        except Exception:
            return None
        self._log.info('No application or server found for alert %s. Will Ignore.', alert_body)

        return
dataset/ETHPy150Open StackStorm/st2contrib/packs/newrelic/sensors/new_relic_app_sensor.py/NewRelicHookSensor._get_hook_handler/original