summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugin/business/tsg-http/src/tsg_logger.cpp29
1 files 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; i<log_msg->result_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; i<log_msg->result_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)