管控策略日志增加字段common_data_center

管控策略统计计数修改
解密流量删除用户自定义判断fata日志
This commit is contained in:
fengweihao
2020-10-23 19:03:08 +08:00
committed by 卢文朋
parent 99731ae689
commit b1c3ba754a
8 changed files with 89 additions and 5 deletions

View File

@@ -17,6 +17,7 @@ struct pangu_logger
int entry_id;
unsigned int en_sendlog;
const char *device_id;
const char *data_center;
void* local_logger;
unsigned long long send_cnt;
@@ -58,6 +59,7 @@ struct pangu_logger* pangu_log_handle_create(const char* profile, const char* s
}
instance->device_id = (const char *)tfe_bussiness_resouce_get(DEVICE_ID);
instance->data_center = (const char *)tfe_bussiness_resouce_get(DATA_CENTER);
instance->kafka_logger = (tfe_kafka_logger_t *)tfe_bussiness_resouce_get(KAFKA_LOGGER);
if (instance->kafka_logger && !instance->kafka_logger->enable)
{
@@ -186,6 +188,11 @@ int pangu_send_log(struct pangu_logger* handle, const struct pangu_log* log_msg)
cJSON_AddNumberToObject(common_obj, "common_s2c_byte_num", s2c_byte_num);
cJSON_AddStringToObject(common_obj, "http_url", http->req->req_spec.url);
cJSON_AddStringToObject(common_obj, "http_host", http->req->req_spec.host);
if(handle->data_center)
{
cJSON_AddStringToObject(common_obj, "common_data_center", handle->data_center);
}
for(size_t i=0;i<sizeof(req_fields)/sizeof(struct json_spec);i++)
{
tmp_val=tfe_http_std_field_read(http->req, req_fields[i].field_id);