From 82d8d068d64c3be675b374132260d5405b8db9b7 Mon Sep 17 00:00:00 2001 From: fengweihao Date: Mon, 22 Jan 2024 14:28:07 +0800 Subject: [PATCH] =?UTF-8?q?TSG-18731=20Proxy=E7=9A=84Monitor=E5=8A=A8?= =?UTF-8?q?=E4=BD=9C=E5=A4=9A=E6=AC=A1=E5=91=BD=E4=B8=AD=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=8F=91=E9=80=81=E4=B8=80=E6=9D=A1=E6=97=A5=E5=BF=97=E4=B8=94?= =?UTF-8?q?Proxy=20Rule=20List=E4=B8=AD=E5=8C=85=E5=90=AB=E5=A4=9A?= =?UTF-8?q?=E6=9D=A1Monitor=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/business/tsg-http/src/tsg_logger.cpp | 29 ++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/plugin/business/tsg-http/src/tsg_logger.cpp b/plugin/business/tsg-http/src/tsg_logger.cpp index 4951a42..13952ac 100644 --- a/plugin/business/tsg-http/src/tsg_logger.cpp +++ b/plugin/business/tsg-http/src/tsg_logger.cpp @@ -336,6 +336,17 @@ int proxy_send_log(struct proxy_logger* handle, const struct proxy_log* log_msg) } } + int j=0, enable_monit=0; + int monit_config_id[16]={0}; + for(size_t i=0; iresult_num; i++) + { + if(log_msg->result[i].action == LG_ACTION_MONIT) + { + monit_config_id[j]=log_msg->result[i].config_id; + j++; + } + } + for(size_t i=0; iresult_num; i++) { TFE_LOG_DEBUG(handle->local_logger, "URL: %s, policy_id: %lld, service: %d, do_log:%d", @@ -349,12 +360,24 @@ int proxy_send_log(struct proxy_logger* handle, const struct proxy_log* log_msg) continue; } + if(log_msg->result[i].action == LG_ACTION_MONIT && enable_monit==1) + { + continue; + } + cJSON *proxy_rule_list=NULL; int config_id[1]={0}; - per_hit_obj=cJSON_Duplicate(common_obj, 1); - config_id[0]=log_msg->result[i].config_id; - proxy_rule_list = cJSON_CreateIntArray(config_id, 1); + if(log_msg->result[i].action == LG_ACTION_MONIT) + { + proxy_rule_list = cJSON_CreateIntArray(monit_config_id, j); + enable_monit=1; + } + else + { + config_id[0]=log_msg->result[i].config_id; + proxy_rule_list = cJSON_CreateIntArray(config_id, 1); + } cJSON_AddItemToObject(per_hit_obj, "proxy_rule_list", proxy_rule_list); cJSON_AddNumberToObject(per_hit_obj, "vsys_id", log_msg->result[i].vsys_id); if(log_msg->result[i].action == LG_ACTION_MANIPULATE)