TSG-18731 Proxy的Monitor动作多次命中时,发送一条日志且Proxy Rule List中包含多条Monitor策略
This commit is contained in:
@@ -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++)
|
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",
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(log_msg->result[i].action == LG_ACTION_MONIT && enable_monit==1)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
cJSON *proxy_rule_list=NULL;
|
cJSON *proxy_rule_list=NULL;
|
||||||
int config_id[1]={0};
|
int config_id[1]={0};
|
||||||
|
|
||||||
per_hit_obj=cJSON_Duplicate(common_obj, 1);
|
per_hit_obj=cJSON_Duplicate(common_obj, 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;
|
config_id[0]=log_msg->result[i].config_id;
|
||||||
proxy_rule_list = cJSON_CreateIntArray(config_id, 1);
|
proxy_rule_list = cJSON_CreateIntArray(config_id, 1);
|
||||||
|
}
|
||||||
cJSON_AddItemToObject(per_hit_obj, "proxy_rule_list", proxy_rule_list);
|
cJSON_AddItemToObject(per_hit_obj, "proxy_rule_list", proxy_rule_list);
|
||||||
cJSON_AddNumberToObject(per_hit_obj, "vsys_id", log_msg->result[i].vsys_id);
|
cJSON_AddNumberToObject(per_hit_obj, "vsys_id", log_msg->result[i].vsys_id);
|
||||||
if(log_msg->result[i].action == LG_ACTION_MANIPULATE)
|
if(log_msg->result[i].action == LG_ACTION_MANIPULATE)
|
||||||
|
|||||||
Reference in New Issue
Block a user