From b62f1236345009fcec490eaec85fe4e23e1b573f Mon Sep 17 00:00:00 2001 From: Tomoya Tanjo Date: Mon, 29 Mar 2021 11:12:48 +0000 Subject: [PATCH] Fix fluent-bit.conf --- .../cwl-metrics/conf/fluent-bit-parsers.conf | 6 ++++++ .../extensions/cwl-metrics/conf/fluent-bit.conf | 17 +++++++++++++++++ lib/ep3/extensions/cwl-metrics/conf/time.lua | 3 +++ 3 files changed, 26 insertions(+) create mode 100644 lib/ep3/extensions/cwl-metrics/conf/fluent-bit-parsers.conf create mode 100644 lib/ep3/extensions/cwl-metrics/conf/time.lua diff --git a/lib/ep3/extensions/cwl-metrics/conf/fluent-bit-parsers.conf b/lib/ep3/extensions/cwl-metrics/conf/fluent-bit-parsers.conf new file mode 100644 index 0000000..90eeb3d --- /dev/null +++ b/lib/ep3/extensions/cwl-metrics/conf/fluent-bit-parsers.conf @@ -0,0 +1,6 @@ +[PARSER] + Name telegraf + Format json + Read_from_Head True + Time_Key timestamp + Time_Keep On diff --git a/lib/ep3/extensions/cwl-metrics/conf/fluent-bit.conf b/lib/ep3/extensions/cwl-metrics/conf/fluent-bit.conf index 2b0609a..5ef1973 100644 --- a/lib/ep3/extensions/cwl-metrics/conf/fluent-bit.conf +++ b/lib/ep3/extensions/cwl-metrics/conf/fluent-bit.conf @@ -1,6 +1,22 @@ +[SERVICE] + Parsers_File ${EP3_EXT_PATH}/cwl-metrics/conf/fluent-bit-parsers.conf + [INPUT] Name tail Path ${MEDAL_TMPDIR}/metrics/container-metrics.json + Parser telegraf + +[FILTER] + Name lua + Match * + script time.lua + call float_time + +[FILTER] + Name parser + Match * + Key_Name log + Parser telegraf [OUTPUT] Name es @@ -8,3 +24,4 @@ Host ${ES_HOST} Port ${ES_PORT} Index metrics + Time_Key timestamp diff --git a/lib/ep3/extensions/cwl-metrics/conf/time.lua b/lib/ep3/extensions/cwl-metrics/conf/time.lua new file mode 100644 index 0000000..7c9f402 --- /dev/null +++ b/lib/ep3/extensions/cwl-metrics/conf/time.lua @@ -0,0 +1,3 @@ +function float_time(tag, timestamp, record) + return 1, record["Timestamp"], record +end