From 9b369538e990d66f5eccb85b7bcfaf7091008200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paolo=20Chil=C3=A0?= Date: Mon, 11 Sep 2023 08:25:37 +0200 Subject: [PATCH] Add Elastic-Api-Version header to kibana client (#148) * Add Elastic-Api-Version header to the default config of kibana client --- kibana/client_config.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kibana/client_config.go b/kibana/client_config.go index 2a47073a..83f25cc6 100644 --- a/kibana/client_config.go +++ b/kibana/client_config.go @@ -23,6 +23,9 @@ import ( "github.com/elastic/elastic-agent-libs/transport/httpcommon" ) +const elasticAPIVersionHeaderKey = "Elastic-Api-Version" +const elasticAPIDefaultVersion = "2023-10-31" + // ClientConfig to connect to Kibana type ClientConfig struct { Protocol string `config:"protocol" yaml:"protocol,omitempty"` @@ -54,6 +57,7 @@ func DefaultClientConfig() ClientConfig { APIKey: "", ServiceToken: "", Transport: httpcommon.DefaultHTTPTransportSettings(), + Headers: map[string]string{elasticAPIVersionHeaderKey: elasticAPIDefaultVersion}, } }