Can't correctly pass timestamp to ElasticSearch
neolunar7 opened this issue · 0 comments
neolunar7 commented
When I deploy k8s event exporter with the setting below, I get the error below.
logLevel: debug
receivers:
- name: "es"
elasticsearch:
hosts:
- MYHOST
index: kube-events
layout:
message: "{{ .Message }}"
reason: "{{ .Reason }}"
type: "{{ .Type }}"
kind: "{{ .Kind }}"
name: "{{ .InvolvedObject.Name }}"
namespace: "{{ .InvolvedObject.Namespace }}"
creationtime: "{{ .Metadata.CreationTimestamp }}"
route:
routes:
- match:
- receiver: "es"
│ 2021-06-08T14:40:05Z DBG bitnami/blacksmith-sandox/kubernetes-event-exporter-0.9.0/src/gitrhub.com/opsgenie/kubernetes-event-exporter/pkg/exporter/channel_registry.go:59 > Cannot send event error="template: template:1:19: executing \"template\" at <.Metadata.CreationTimetstamp>: can't evaluate field Metadata in type *kube.EnhancedEvent"
How can I correctly pass timestamp format into Elasticsearch ?