From 89fc2ff58753a836c6d3d538dbba774bd7bb322e Mon Sep 17 00:00:00 2001 From: TeoV Date: Wed, 30 Sep 2020 09:35:10 +0300 Subject: [PATCH] Populate Addreses out of ExportPath --- ees/elastic.go | 7 +++++-- utils/consts.go | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ees/elastic.go b/ees/elastic.go index e03068e2b..31503bd64 100644 --- a/ees/elastic.go +++ b/ees/elastic.go @@ -19,6 +19,7 @@ along with this program. If not, see package ees import ( + "strings" "sync" "github.com/cgrates/cgrates/config" @@ -48,9 +49,11 @@ type ElasticEe struct { // init will create all the necessary dependencies, including opening the file func (eEe *ElasticEe) init() (err error) { - // compose the config out of opts // create the client - if eEe.eClnt, err = elasticsearch.NewDefaultClient(); err != nil { + if eEe.eClnt, err = elasticsearch.NewClient( + elasticsearch.Config{ + Addresses: strings.Split(eEe.cgrCfg.EEsCfg().Exporters[eEe.cfgIdx].ExportPath, utils.INFIELD_SEP), + }); err != nil { return } return diff --git a/utils/consts.go b/utils/consts.go index a65c1a7a1..9de5e62cd 100755 --- a/utils/consts.go +++ b/utils/consts.go @@ -525,6 +525,7 @@ const ( MetaHourly = "*hourly" ID = "ID" Address = "Address" + Addresses = "Addresses" Transport = "Transport" TLS = "TLS" Subsystems = "Subsystems"