Possibility to use elasticsearch datastreams
applike-ss opened this issue · 4 comments
applike-ss commented
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}
anannaya commented
@applike-ss Do you have built image?
applike-ss commented
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
anannaya commented
@applike-ss Thanks for the PR which solved my issue.
applike-ss commented
Happy to help :-)