diff --git a/src/entry/Maat_api.cpp b/src/entry/Maat_api.cpp index 3a96137..c0a63f3 100644 --- a/src/entry/Maat_api.cpp +++ b/src/entry/Maat_api.cpp @@ -631,6 +631,10 @@ int Maat_set_feather_opt(Maat_feather_t feather,enum MAAT_INIT_OPT type,const vo break; case MAAT_OPT_JSON_FILE_PATH: assert(_feather->input_mode==SOURCE_NONE); + MESA_handle_runtime_log(_feather->logger,RLOG_LV_INFO,maat_module , + "Maat initial with JSON file %s, formating..", + (const char*)value); + ret=json2iris((const char*)value, _feather->compile_tn,_feather->group_tn, NULL, @@ -647,7 +651,7 @@ int Maat_set_feather_opt(Maat_feather_t feather,enum MAAT_INIT_OPT type,const vo md5_file(_feather->json_ctx.json_file, _feather->json_ctx.effective_json_md5); MESA_handle_runtime_log(_feather->logger,RLOG_LV_INFO,maat_module , - "Maat initial with JSON file %s md5: %s, generate index file %s OK.", + "JSON file %s md5: %s, generate index file %s OK.", _feather->json_ctx.json_file, _feather->json_ctx.effective_json_md5, _feather->json_ctx.iris_file); diff --git a/src/entry/Maat_rule.cpp b/src/entry/Maat_rule.cpp index 4fb6d79..9c0991e 100644 --- a/src/entry/Maat_rule.cpp +++ b/src/entry/Maat_rule.cpp @@ -33,7 +33,7 @@ #include "stream_fuzzy_hash.h" #include "gram_index_engine.h" -int MAAT_FRAME_VERSION_2_8_20190728=1; +int MAAT_FRAME_VERSION_2_8_20190816=1; int is_valid_expr_type(enum MAAT_EXPR_TYPE expr_type) diff --git a/src/entry/json2iris.cpp b/src/entry/json2iris.cpp index e6b175b..79da6c5 100644 --- a/src/entry/json2iris.cpp +++ b/src/entry/json2iris.cpp @@ -937,8 +937,6 @@ int write_index_file(struct iris_description_t *p_iris,void* logger) int write_group_rule(cJSON *group_json, int parent_id, int parent_type, int tracking_compile_id, struct iris_description_t *p_iris, void* logger) { const char* _str_parent_type[2]={"compile", "group"}; - int i=0; - int sub_group_cnt=0, region_cnt=0; int ret=0; int group_not_flag=0; cJSON *region_json=NULL, *item=NULL; @@ -1005,10 +1003,8 @@ int write_group_rule(cJSON *group_json, int parent_id, int parent_type, int trac region_json=cJSON_GetObjectItem(group_json,"regions"); if(region_json!=NULL) { - region_cnt=cJSON_GetArraySize(region_json); - for(i=0; igroup_id, p_iris, logger); if(ret<0) { @@ -1022,10 +1018,9 @@ int write_group_rule(cJSON *group_json, int parent_id, int parent_type, int trac if(sub_groups!=NULL) { //recursively - sub_group_cnt=cJSON_GetArraySize(sub_groups); - for(i=0; igroup_id, PARENT_TYPE_GROUP, tracking_compile_id, p_iris, logger); if(ret<0) { @@ -1037,18 +1032,16 @@ int write_group_rule(cJSON *group_json, int parent_id, int parent_type, int trac } int write_iris(cJSON *json, struct iris_description_t *p_iris, void* logger) { - int i=0,j=0; - int compile_id=-1, compile_cnt=0, group_cnt=0, plug_table_cnt=0; + int i=0; + int compile_id=-1, compile_cnt=0, group_cnt=0; int ret=0; cJSON *c_rules=NULL, *g_rules=NULL, *plug_tables=NULL; cJSON *compile_rule=NULL,*group_rule=NULL, *each_plug_table=NULL; plug_tables=cJSON_GetObjectItem(json,"plugin_table"); if(NULL!=plug_tables) { - plug_table_cnt=cJSON_GetArraySize(plug_tables); - for(i=0;i