From 902a41129578a00a3110fb0c1f73fcfbd33c3e44 Mon Sep 17 00:00:00 2001 From: andronache Date: Tue, 11 May 2021 08:36:42 +0300 Subject: [PATCH] Added option for field separator for Event Exporter Config and refactored some opts --- config/config_defaults.go | 4 ++-- data/conf/cgrates/cgrates.json | 4 ++-- ees/filecsv.go | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config/config_defaults.go b/config/config_defaults.go index 470bc177f..638b1bbfd 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -464,8 +464,8 @@ const CGRATES_CFG_JSON = ` // AMQP // "amqpQueueID": "cgrates_cdrs", // the queue id for AMQP exporters from were the events are exported // "amqpRoutingKey": "", // RoutingKey - // "sqlExchange": "", // Exchange - // "sqlExchangeType": "", // ExchangeType + // "amqpExchange": "", // Exchange + // "amqpExchangeType": "", // ExchangeType // SQS and S3 diff --git a/data/conf/cgrates/cgrates.json b/data/conf/cgrates/cgrates.json index e97fde0ad..0d9ad10ec 100755 --- a/data/conf/cgrates/cgrates.json +++ b/data/conf/cgrates/cgrates.json @@ -356,8 +356,8 @@ // // AMQP // // "consumerTag": "cgrates", // the ID of the consumer -// // "sqlExchange": "", -// // "sqlExchangeType": "", +// // "amqpExchange": "", +// // "amqpExchangeType": "", // // "amqpRoutingKey": "", // // "exchangeProcessed": "", diff --git a/ees/filecsv.go b/ees/filecsv.go index 0e1bd5205..f25182314 100644 --- a/ees/filecsv.go +++ b/ees/filecsv.go @@ -68,6 +68,9 @@ func (fCsv *FileCSVee) init() (err error) { if len(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].FieldSep) > 0 { fCsv.csvWriter.Comma = rune(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].FieldSep[0]) } + if fieldSep, has := fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].Opts[utils.CSV+utils.FieldSepOpt]; has { + fCsv.csvWriter.Comma = rune(utils.IfaceAsString(fieldSep)[0]) + } return fCsv.composeHeader() }