async def METHOD_NAME(es, df):
    # This function will be updating Opensearch logs which were inferred on by the DRAIN model.
    model_keywords_dict = {"drain":  ["_id", "masked_log", "template_matched","template_cluster_id","inference_model", "anomaly_level"],
                          "opnilog":  ["_id", "masked_log", "anomaly_level", "template_matched","template_cluster_id","opnilog_confidence", "inference_model"]}
    anomaly_level_options = ["Normal", "Anomaly"]
    for model_name in model_keywords_dict:
        model_df = df[df["inference_model"] == model_name]
        for anomaly_level in anomaly_level_options:
            anomaly_level_df = model_df[model_df["anomaly_level"] == anomaly_level]
            if len(anomaly_level_df) == 0:
                continue
            try:
                async for ok, result in async_streaming_bulk(
                        es,
                        doc_generator(
                            anomaly_level_df[model_keywords_dict[model_name]],
                            "logs",
                        ),
                        max_retries=5,
                        initial_backoff=1,
                        request_timeout=5,
                ):
                    action, result = result.popitem()
                    if not ok:
                        logging.error("failed to {} document {}".format())
            except (BulkIndexError, ConnectionTimeout, TimeoutError) as exception:
                logging.error(
                    "Failed to index data. Re-adding to queue"
                )
                logging.error(exception)