Populate Addreses out of ExportPath

This commit is contained in:
TeoV
2020-09-30 09:35:10 +03:00
committed by Dan Christian Bogos
parent ff9d658e6b
commit 89fc2ff587
2 changed files with 6 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
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

View File

@@ -525,6 +525,7 @@ const (
MetaHourly = "*hourly"
ID = "ID"
Address = "Address"
Addresses = "Addresses"
Transport = "Transport"
TLS = "TLS"
Subsystems = "Subsystems"