From e5121a0ed1ca968092a673e07574bc004ee31fc7 Mon Sep 17 00:00:00 2001 From: kev Date: Tue, 9 Nov 2021 17:03:12 +0800 Subject: [PATCH] add benthos --- README.md | 1 + benthos/README.md | 55 ++++++++++++++++++++++++++++++++++++++ benthos/data/config.yaml | 18 +++++++++++++ benthos/data/output.txt | 2 ++ benthos/docker-compose.yml | 10 +++++++ 5 files changed, 86 insertions(+) create mode 100644 benthos/README.md create mode 100644 benthos/data/config.yaml create mode 100644 benthos/data/output.txt create mode 100644 benthos/docker-compose.yml diff --git a/README.md b/README.md index c62e479..547656b 100644 --- a/README.md +++ b/README.md @@ -298,6 +298,7 @@ A collection of delicious docker recipes. - [x] ghcr.io/linuxserver/airsonic :musical_note: - [x] archivebox/archivebox - [x] docker.bintray.io/jfrog/artifactory-oss +- [x] jeffail/benthos - [x] tutum/builder - [x] browserless/chrome - [x] certbot diff --git a/benthos/README.md b/benthos/README.md new file mode 100644 index 0000000..30618ba --- /dev/null +++ b/benthos/README.md @@ -0,0 +1,55 @@ +benthos +======= + +![](https://github.com/Jeffail/benthos/raw/master/icon.png) + +[Benthos][1] is a high performance and resilient stream processor, able to +connect various sources and sinks in a range of brokering patterns and perform +hydration, enrichments, transformations and filters on payloads. + +## docker-compose.yml + +```yaml +version: "3.8" +services: + benthos: + image: jeffail/benthos + command: -c /etc/benthos/config.yaml + ports: + - "4195:4195" + volumes: + - ./data:/etc/benthos + restart: unless-stopped +``` + +## config.yaml + +```yaml +input: + mqtt: + urls: + - tcp://broker.hivemq.com:1883 + topics: + - easypi + +pipeline: + processors: + - jq: + query: . + - http: + url: https://httpbin.org/post + +output: + stdout: + codec: lines +``` + +## up and running + +```bash +$ docker-compose up -d +$ docker-compose logs -f +$ mosquitto_pub -h broker.hivemq.com -p 1883 -t easypi -m '{"hello":"world"}' +``` + +[1]: https://github.com/Jeffail/benthos diff --git a/benthos/data/config.yaml b/benthos/data/config.yaml new file mode 100644 index 0000000..e0c75bb --- /dev/null +++ b/benthos/data/config.yaml @@ -0,0 +1,18 @@ +input: + mqtt: + urls: + - tcp://broker.hivemq.com:1883 + topics: + - easypi + +pipeline: + processors: + - jq: + query: . + - http: + url: https://httpbin.org/post + verb: POST + +output: + stdout: + codec: lines diff --git a/benthos/data/output.txt b/benthos/data/output.txt new file mode 100644 index 0000000..b307639 --- /dev/null +++ b/benthos/data/output.txt @@ -0,0 +1,2 @@ +{"hello":"world"} +{"foo":"bar"} diff --git a/benthos/docker-compose.yml b/benthos/docker-compose.yml new file mode 100644 index 0000000..eda7c0a --- /dev/null +++ b/benthos/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3.8" +services: + benthos: + image: jeffail/benthos + command: -c /etc/benthos/config.yaml + ports: + - "4195:4195" + volumes: + - ./data:/etc/benthos + restart: unless-stopped