diff --git a/common/include/tfe_fieldstat.h b/common/include/tfe_fieldstat.h index 5f1fb49..7b0ee5e 100644 --- a/common/include/tfe_fieldstat.h +++ b/common/include/tfe_fieldstat.h @@ -21,7 +21,8 @@ enum metric_columns_index enum metric_tags_index { - TAG_RULE_ID = 0, + TAG_VSYS_ID = 0, + TAG_RULE_ID, TAG_PINNING_STATUS, TAG_ACTION, TAG_SUB_ACTION, diff --git a/common/src/tfe_fieldstat.cpp b/common/src/tfe_fieldstat.cpp index e46a2c0..69a27b3 100644 --- a/common/src/tfe_fieldstat.cpp +++ b/common/src/tfe_fieldstat.cpp @@ -10,7 +10,7 @@ struct tfe_fieldstat_metric_t *tfe_fieldstat_metric_create(char *telegraf_ip, in { int i=0; - struct fieldstat_tag metric_tags[TAG_MAX] = {{"rule_id", 0, -1}, {"pinning_status", 0, -1 }, {"action", 0, -1}, {"sub_action", 2, -1} }; + struct fieldstat_tag metric_tags[TAG_MAX] = {{"vsys_id", 0, -1}, {"rule_id", 0, -1}, {"pinning_status", 0, -1 }, {"action", 0, -1}, {"sub_action", 2, -1} }; const char *column_field[COLUMN_MAX] = {"hit_count", "in_bytes", "out_bytes", "in_pkts", "out_pkts"}; enum field_type column_type[COLUMN_MAX] = {FIELD_TYPE_COUNTER, FIELD_TYPE_COUNTER, FIELD_TYPE_COUNTER, FIELD_TYPE_COUNTER, FIELD_TYPE_COUNTER}; diff --git a/plugin/business/doh/src/doh.cpp b/plugin/business/doh/src/doh.cpp index d622f5e..3cde45e 100644 --- a/plugin/business/doh/src/doh.cpp +++ b/plugin/business/doh/src/doh.cpp @@ -862,6 +862,7 @@ void doh_send_metric_log(const struct tfe_stream * stream, struct doh_ctx *ctx, size_t c2s_byte_num = 0, s2c_byte_num =0; struct tfe_fieldstat_metric_t *fieldstat = (struct tfe_fieldstat_metric_t *)tfe_bussiness_resouce_get(DYNAMIC_FIELDSTAT); + fieldstat->tags[thread_id][TAG_VSYS_ID].value_int = ctx->result->vsys_id; fieldstat->tags[thread_id][TAG_RULE_ID].value_int = ctx->result->config_id; fieldstat->tags[thread_id][TAG_ACTION].value_int = 48; fieldstat->tags[thread_id][TAG_SUB_ACTION].value_str = "redirect"; diff --git a/plugin/business/tsg-http/src/tsg_http.cpp b/plugin/business/tsg-http/src/tsg_http.cpp index 7d641b1..e6f6bd3 100644 --- a/plugin/business/tsg-http/src/tsg_http.cpp +++ b/plugin/business/tsg-http/src/tsg_http.cpp @@ -3270,6 +3270,7 @@ void proxy_send_metric_log(const struct tfe_stream * stream, struct proxy_http_c for(i=0; i< ctx->n_enforce; i++) { + fieldstat->tags[thread_id][TAG_VSYS_ID].value_int = ctx->enforce_rules[i].vsys_id; fieldstat->tags[thread_id][TAG_RULE_ID].value_int = ctx->enforce_rules[i].config_id; fieldstat->tags[thread_id][TAG_ACTION].value_int = ctx->enforce_rules[i].action; if(ctx->enforce_rules[i].action == PX_ACTION_MANIPULATE)