opsgenie/kubernetes-event-exporter

Possibility to use elasticsearch datastreams

applike-ss opened this issue · 4 comments

We would like to be able to write into an elasticsearch datastream instead of into an index directly.
Is there such a functionality planned or even alread existing?
I couldn't find anything in the Readme.md and couldn't find any other docs.

We are getting this kind of message when trying to write into a datastream:

2021-11-26T09:02:50Z ERR bitnami/blacksmith-sandox/kubernetes-event-exporter-0.11.0/src/github.com/opsgenie/kubernetes-event-exporter/pkg/sinks/elasticsearch.go:144 > Indexing failed: {"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"failed to parse"}],"type":"mapper_parsing_exception","reason":"failed to parse","caused_by":{"type":"illegal_argument_exception","reason":"data stream timestamp field [@timestamp] is missing"}},"status":400}

See: https://www.elastic.co/guide/en/elasticsearch/reference/current/set-up-a-data-stream.html#create-data-stream

@applike-ss Do you have built image?

Yes, i used this dockerfile:

FROM golang:1.17 AS builder

ADD . /app
WORKDIR /app
RUN CGO_ENABLED=0 GOOS=linux GO11MODULE=on go build -mod=vendor -a -o /main .

FROM docker.io/bitnami/kubernetes-event-exporter:0.11.0-debian-10-r0
COPY --from=builder /main /opt/bitnami/kubernetes-event-exporter/bin/kubernetes-event-exporter

@applike-ss Thanks for the PR which solved my issue.

Happy to help :-)