From 71c5783fdc50e5d919e2449426bbc529caaaf769 Mon Sep 17 00:00:00 2001 From: RAGOT David <35502263+Dav-14@users.noreply.github.com> Date: Fri, 10 Nov 2023 16:39:49 +0100 Subject: [PATCH] fix: change indexed fields (#842) Co-authored-by: David Ragot --- components/gateway/internal/audit/messages/audit.go | 3 +-- components/gateway/pkg/plugins/audit.go | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/deployments-apps-v1/search-benthos.yaml | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/deployments-apps-v1/search-benthos.yaml | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/deployments-apps-v1/search-benthos.yaml | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/deployments-apps-v1/search-benthos.yaml | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/deployments-apps-v1/search-benthos.yaml | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/deployments-apps-v1/search-benthos.yaml | 2 +- .../results/configmaps--v1/search-benthos-streams.yaml | 2 +- .../results/deployments-apps-v1/search-benthos.yaml | 2 +- components/search/benthos/streams/gateway_audit.yaml | 7 ++----- 23 files changed, 24 insertions(+), 28 deletions(-) diff --git a/components/gateway/internal/audit/messages/audit.go b/components/gateway/internal/audit/messages/audit.go index b1a8542f16..f0fd3190b8 100644 --- a/components/gateway/internal/audit/messages/audit.go +++ b/components/gateway/internal/audit/messages/audit.go @@ -2,7 +2,6 @@ package messages import ( "net/http" - "net/url" "time" "github.com/formancehq/stack/libs/go-libs/publish" @@ -17,7 +16,7 @@ const ( type HttpRequest struct { Method string `json:"method"` - Url *url.URL `json:"path"` + Path string `json:"path"` Host string `json:"host"` Header http.Header `json:"header"` Body string `json:"body,omitempty"` diff --git a/components/gateway/pkg/plugins/audit.go b/components/gateway/pkg/plugins/audit.go index 2174272f11..89d6bf1ac9 100644 --- a/components/gateway/pkg/plugins/audit.go +++ b/components/gateway/pkg/plugins/audit.go @@ -287,7 +287,7 @@ func (a *Audit) provisionKafkaPublisher() error { func (a Audit) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error { request := messages.HttpRequest{ Method: r.Method, - Url: r.URL, + Path: r.URL.Path, Host: r.Host, Header: r.Header, Body: "", diff --git a/components/operator/internal/controllers/stack/testdata/monopod-disabled-one-service/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/monopod-disabled-one-service/results/configmaps--v1/search-benthos-streams.yaml index cd14c04968..077c4e73d2 100644 --- a/components/operator/internal/controllers/stack/testdata/monopod-disabled-one-service/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/monopod-disabled-one-service/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/monopod-latest/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/monopod-latest/results/configmaps--v1/search-benthos-streams.yaml index 38d71c35bd..608b852c4d 100644 --- a/components/operator/internal/controllers/stack/testdata/monopod-latest/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/monopod-latest/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/monopod-ledgerv1/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/monopod-ledgerv1/results/configmaps--v1/search-benthos-streams.yaml index 36747feb53..22d38fb3fa 100644 --- a/components/operator/internal/controllers/stack/testdata/monopod-ledgerv1/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/monopod-ledgerv1/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/monopod-payments-after-v1.0.0-alpha.6/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/monopod-payments-after-v1.0.0-alpha.6/results/configmaps--v1/search-benthos-streams.yaml index de0d430680..7283628730 100644 --- a/components/operator/internal/controllers/stack/testdata/monopod-payments-after-v1.0.0-alpha.6/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/monopod-payments-after-v1.0.0-alpha.6/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/monopod-payments-before-v1.0.0-alpha.6/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/monopod-payments-before-v1.0.0-alpha.6/results/configmaps--v1/search-benthos-streams.yaml index 3925b400f1..0a18a4d197 100644 --- a/components/operator/internal/controllers/stack/testdata/monopod-payments-before-v1.0.0-alpha.6/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/monopod-payments-before-v1.0.0-alpha.6/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/monopod-search-before-v0.7.0/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/monopod-search-before-v0.7.0/results/configmaps--v1/search-benthos-streams.yaml index 5d69b64af3..103f003946 100644 --- a/components/operator/internal/controllers/stack/testdata/monopod-search-before-v0.7.0/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/monopod-search-before-v0.7.0/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/multipod-debug/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/multipod-debug/results/configmaps--v1/search-benthos-streams.yaml index 233c8a4fe7..a6c423fc4d 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-debug/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-debug/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/multipod-debug/results/deployments-apps-v1/search-benthos.yaml b/components/operator/internal/controllers/stack/testdata/multipod-debug/results/deployments-apps-v1/search-benthos.yaml index 850ac0710a..978ead6b00 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-debug/results/deployments-apps-v1/search-benthos.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-debug/results/deployments-apps-v1/search-benthos.yaml @@ -20,7 +20,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: 3UvKysPmdF7bqb4IU8sFGZNFBwGGp6WpargQQpKvvtY= + stack.formance.cloud/volumes-hash: UXfSw4__EAaJBZzasvjSEBQdMgu0fIS1hfvkTevjxEM= creationTimestamp: null labels: app.kubernetes.io/name: search-benthos diff --git a/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/configmaps--v1/search-benthos-streams.yaml index 0d185d5f28..cf9039f7e1 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/deployments-apps-v1/search-benthos.yaml b/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/deployments-apps-v1/search-benthos.yaml index bde3e3c2f5..9f24fad21f 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/deployments-apps-v1/search-benthos.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/deployments-apps-v1/search-benthos.yaml @@ -20,7 +20,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: 3UvKysPmdF7bqb4IU8sFGZNFBwGGp6WpargQQpKvvtY= + stack.formance.cloud/volumes-hash: UXfSw4__EAaJBZzasvjSEBQdMgu0fIS1hfvkTevjxEM= creationTimestamp: null labels: app.kubernetes.io/name: search-benthos diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/configmaps--v1/search-benthos-streams.yaml index 7401480bd2..f2b4d850aa 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/deployments-apps-v1/search-benthos.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/deployments-apps-v1/search-benthos.yaml index 554b9d68e3..684804ebf9 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/deployments-apps-v1/search-benthos.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/deployments-apps-v1/search-benthos.yaml @@ -20,7 +20,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: FfOv01oEUm1Fv6d_CaNm87DiFt5YY-B9eduuG7mnfRI= + stack.formance.cloud/volumes-hash: 5ZhZ4XOoB_1eN_Wmql9Gy9zB5Zzhk8S4ZAcNpVNBNQE= creationTimestamp: null labels: app.kubernetes.io/name: search-benthos diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/configmaps--v1/search-benthos-streams.yaml index adb81ac87e..0d027b1ccf 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/deployments-apps-v1/search-benthos.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/deployments-apps-v1/search-benthos.yaml index bd20c34d34..21a16d9aef 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/deployments-apps-v1/search-benthos.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/deployments-apps-v1/search-benthos.yaml @@ -20,7 +20,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: 3UvKysPmdF7bqb4IU8sFGZNFBwGGp6WpargQQpKvvtY= + stack.formance.cloud/volumes-hash: UXfSw4__EAaJBZzasvjSEBQdMgu0fIS1hfvkTevjxEM= creationTimestamp: null labels: app.kubernetes.io/name: search-benthos diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/configmaps--v1/search-benthos-streams.yaml index c1173a5bcd..2b52d5ad28 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/deployments-apps-v1/search-benthos.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/deployments-apps-v1/search-benthos.yaml index b3f424e734..cc37e4aacb 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/deployments-apps-v1/search-benthos.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/deployments-apps-v1/search-benthos.yaml @@ -20,7 +20,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: 3UvKysPmdF7bqb4IU8sFGZNFBwGGp6WpargQQpKvvtY= + stack.formance.cloud/volumes-hash: UXfSw4__EAaJBZzasvjSEBQdMgu0fIS1hfvkTevjxEM= creationTimestamp: null labels: app.kubernetes.io/name: search-benthos diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest/results/configmaps--v1/search-benthos-streams.yaml index d11c34c9be..1d4b464e2f 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest/results/deployments-apps-v1/search-benthos.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest/results/deployments-apps-v1/search-benthos.yaml index e0cb783c9a..f6cd95f2fa 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest/results/deployments-apps-v1/search-benthos.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest/results/deployments-apps-v1/search-benthos.yaml @@ -20,7 +20,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: 3UvKysPmdF7bqb4IU8sFGZNFBwGGp6WpargQQpKvvtY= + stack.formance.cloud/volumes-hash: UXfSw4__EAaJBZzasvjSEBQdMgu0fIS1hfvkTevjxEM= creationTimestamp: null labels: app.kubernetes.io/name: search-benthos diff --git a/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/configmaps--v1/search-benthos-streams.yaml index 570752cc7d..908e0c3379 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/configmaps--v1/search-benthos-streams.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/configmaps--v1/search-benthos-streams.yaml @@ -1,6 +1,6 @@ apiVersion: v1 data: - gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"request\": this.payload.request,\n \"response\": this.payload.response,\n \"when\": this.date\n },\n \"kind\": \"AUDIT\",\n \"when\": this.date\n }\n\n\noutput:\n resource: elasticsearch\n" + gateway_audit.yaml: "input:\n event_bus:\n topic: audit\n consumer_group: search-audit\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: AUDIT\n processors:\n - bloblang: |\n meta id = \"AUDIT-%s\".format(this.payload.id)\n meta action = \"index\"\n \n root = {\n \"data\": this.payload,\n \"indexed\": {\n \"path\": this.payload.request.path,\n },\n \"kind\": \"AUDIT\"\n }\n\n\noutput:\n resource: elasticsearch\n" ledger_ingestion.yaml: | --- input: diff --git a/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/deployments-apps-v1/search-benthos.yaml b/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/deployments-apps-v1/search-benthos.yaml index 1fcf3d4778..0f3ceea1b2 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/deployments-apps-v1/search-benthos.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/deployments-apps-v1/search-benthos.yaml @@ -20,7 +20,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: FfOv01oEUm1Fv6d_CaNm87DiFt5YY-B9eduuG7mnfRI= + stack.formance.cloud/volumes-hash: 5ZhZ4XOoB_1eN_Wmql9Gy9zB5Zzhk8S4ZAcNpVNBNQE= creationTimestamp: null labels: app.kubernetes.io/name: search-benthos diff --git a/components/search/benthos/streams/gateway_audit.yaml b/components/search/benthos/streams/gateway_audit.yaml index 1e0a22b017..9fdbd1a261 100644 --- a/components/search/benthos/streams/gateway_audit.yaml +++ b/components/search/benthos/streams/gateway_audit.yaml @@ -18,12 +18,9 @@ pipeline: root = { "data": this.payload, "indexed": { - "request": this.payload.request, - "response": this.payload.response, - "when": this.date + "path": this.payload.request.path, }, - "kind": "AUDIT", - "when": this.date + "kind": "AUDIT" }