From 10010d8583058a0bbfd06dfc82bc3bfb6195b6c0 Mon Sep 17 00:00:00 2001 From: Romain Dauby Date: Sun, 19 Nov 2023 14:36:34 -0500 Subject: [PATCH] Prepare env to work with Fluentd for TLS impl --- Makefile | 10 +++++++--- README.md | 4 ++-- testdata/fluentd.conf | 16 ++++++++++++++++ 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 testdata/fluentd.conf diff --git a/Makefile b/Makefile index cc7675d..1f444eb 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,10 @@ generate-logs: ./scripts/generate-logs.sh 100 >> testdata/access.log .PHONY:generate-logs -prepare: - docker run -d --name fluent --rm -p 127.0.0.1:24224:24224 fluent/fluent-bit /fluent-bit/bin/fluent-bit -i forward -o stdout -p format=json_lines -f 1 -.PHONY:prepare \ No newline at end of file +run-fluentbit: + docker run --name fluentbit --rm -p 127.0.0.1:24224:24224 fluent/fluent-bit /fluent-bit/bin/fluent-bit -i forward -o stdout -p format=json_lines -f 1 +.PHONY:run-fluentbit + +run-fluentd: + docker run --name fluentd --rm -p 127.0.0.1:24224:24224 -v ./testdata/fluentd.conf:/fluentd/etc/fluentd.conf:ro fluent/fluentd:v1.16-debian-amd64-1 -c /fluentd/etc/fluentd.conf -v +.PHONY:run-fluentd \ No newline at end of file diff --git a/README.md b/README.md index 2e657d7..0e87720 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ git clone --recurse-submodules git@github.com:r0mdau/otelcol-dev.git Run a [Fluent Bit](https://fluentbit.io/) instance that will receive messages over TCP port 24224 through the [fluent-forward](https://docs.fluentbit.io/manual/pipeline/outputs/forward) protocol and send the messages to stdout interface in JSON format every second ```bash -docker run --name fluent --rm -p 127.0.0.1:24224:24224 fluent/fluent-bit /fluent-bit/bin/fluent-bit -i forward -o stdout -p format=json_lines -f 1 +make prepare ``` Build the custom collector @@ -41,7 +41,7 @@ bash scripts/generate-logs.sh 100 >> testdata/access.log Look at Fluentbit logs ```bash -docker logs fluent +docker logs fluentbit ``` ### Customize the otel modules diff --git a/testdata/fluentd.conf b/testdata/fluentd.conf new file mode 100644 index 0000000..15bd346 --- /dev/null +++ b/testdata/fluentd.conf @@ -0,0 +1,16 @@ + + @type forward + @id input1 + @label @mainstream + port 24224 + + + + @type stdout + + + \ No newline at end of file