From 65833d7a1e16217953c490cdfa7002f4c07d5978 Mon Sep 17 00:00:00 2001 From: liuxueli Date: Thu, 18 Jun 2020 14:11:02 +0800 Subject: [PATCH] =?UTF-8?q?tsg=5Fstat.log=E6=8C=89=E7=85=A7influx=5Fline?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=BE=93=E5=87=BA=E5=88=B0telegraf=20IP?= =?UTF-8?q?=E5=BD=92=E5=B1=9E=E5=9C=B0=E6=97=A5=E5=BF=97=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tsg_entry.cpp | 3 +++ src/tsg_send_log.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tsg_entry.cpp b/src/tsg_entry.cpp index 3ee9402..c19b82f 100644 --- a/src/tsg_entry.cpp +++ b/src/tsg_entry.cpp @@ -985,6 +985,9 @@ extern "C" int TSG_MASTER_INIT() FS_set_para(g_tsg_para.fs2_handle, STATS_SERVER_PORT,&(fs_server_port), sizeof(fs_server_port)); } + value=FS_OUTPUT_INFLUX_LINE; + FS_set_para(g_tsg_para.fs2_handle, STATS_FORMAT, &value, sizeof(value)); + for(i=0; iclient_location!=NULL) { location=internal_label->client_location; - snprintf(buff, sizeof(buff), "%s%s%s%s%s", location->country_full, (strlen(location->province_full)>0) ? "," : "", location->province_full, (strlen(location->city_full)>0) ? "," : "", location->city_full); + snprintf(buff, sizeof(buff), "%s,%s,%s", location->city_full, location->province_full, location->country_full); TLD_append(_handle, _instance->id2field[LOG_COMMON_CLINET_LOCATION].name, (void *)buff, TLD_TYPE_STRING); } if(internal_label->server_location!=NULL) { location=internal_label->server_location; - snprintf(buff, sizeof(buff), "%s%s%s%s%s", location->country_full, (strlen(location->province_full)>0) ? "," : "", location->province_full, (strlen(location->city_full)>0) ? "," : "", location->city_full); + snprintf(buff, sizeof(buff), "%s,%s,%s", location->city_full, location->province_full, location->country_full); TLD_append(_handle, _instance->id2field[LOG_COMMON_SERVER_LOCATION].name, (void *)buff, TLD_TYPE_STRING); } }