def foreign_logs_enricher(event: ExecutionBaseEvent, params: ForeignLogParams):
    """
    Generic enricher to fetch and attach pod logs.

    The logs are fetched for the pod determined by the label selector field in the parameters.
    """

    api = client.CoreV1Api()
    matching_pods: List[V1Pod] = []

    logging.debug(f"received a foreign_logs_enricher action: {params}")

    for selector in params.label_selectors:
        try:
            pods: V1PodList = api.list_pod_for_all_namespaces(label_selector=selector)
            if pods.items:
                matching_pods = pods.items
                break
        except Exception as e:
            if not (isinstance(e, exceptions.ApiException) and e.status == 404):
                raise ActionException(
                    ErrorCodes.ACTION_UNEXPECTED_ERROR,
                    f"[foreign_logs_enricher] Failed to list pods for foreign log enricher.\n{e}",
                )

    if not matching_pods:
        logging.warning(
            f"[foreign_logs_enricher] failed to find any matching pods for the selectors: {params.label_selectors}"
        )
        return
    for matching_pod in matching_pods:
        pod = RobustaPod().read(matching_pod.metadata.name, matching_pod.metadata.namespace)
        title_override = format_pod_templated_string(pod, params.title_override)
        start_log_enrichment(event=event, params=params, pod=pod, title_override=title_override)

    Generic enricher to fetch and attach pod logs.

    The logs are fetched for the pod determined by the label selector field in the parameters.
    
playbooks/robusta_playbooks/alerts_integration.py