From 6dff8fb59764b3fac945d01fdd6da40f6657ab6d Mon Sep 17 00:00:00 2001 From: luwenpeng Date: Tue, 28 Feb 2023 19:05:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0sce=20telegraf.conf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/sce_telegraf.conf | 66 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 conf/sce_telegraf.conf diff --git a/conf/sce_telegraf.conf b/conf/sce_telegraf.conf new file mode 100644 index 0000000..cb64c02 --- /dev/null +++ b/conf/sce_telegraf.conf @@ -0,0 +1,66 @@ +# Telegraf Configuration +[global_tags] + device_id = "123456" + vsys_id = "1" + device_group = "group-xxg-x-test" + data_center = "center-xxg-x-test" + +[agent] + interval = "1s" + round_interval = true + metric_batch_size = 1000 + metric_buffer_limit = 10000 + collection_jitter = "0s" + flush_interval = "1s" + flush_jitter = "0s" + precision = "" + debug = false + quiet = false + logfile = "" + hostname = "" + omit_hostname = true + +[[inputs.socket_listener]] + service_address = "udp://:8300" + data_format = "influx" + +[[processors.rename]] + [[processors.rename.replace]] + field = "sent_pkts_sum" + dest = "sent_pkts" + + [[processors.rename.replace]] + field = "sent_bytes_sum" + dest = "sent_bytes" + + [[processors.rename.replace]] + field = "recv_pkts_sum" + dest = "recv_pkts" + + [[processors.rename.replace]] + field = "recv_bytes_sum" + dest = "recv_bytes" + +[[aggregators.basicstats]] + period = "1s" + drop_original = true + stats = ["sum"] + fieldpass = ["sent_pkts", "sent_bytes", "recv_pkts", "recv_bytes"] + namepass = ["service_chaining_metrics"] # only "pass" swap metrics through the aggregator. + +[[outputs.file]] + files = ["/tmp/sce_metrics.json", "stdout"] + data_format = "json" + json_transformation = ''' + $merge([{"timestamp": timestamp}, tags, fields]) + ''' + +[[outputs.kafka]] + sasl_username = "admin" + sasl_password = "galaxy2019" + brokers = [ "192.168.44.12:9094" ] + topic = "SERVICE-CHAINING-METRICS" + data_format = "json" + json_transformation = ''' + $merge([{"timestamp": timestamp}, tags, fields]) + ''' \ No newline at end of file