Added option for field separator for Event Exporter Config and refactored some opts

This commit is contained in:
andronache
2021-05-11 08:36:42 +03:00
committed by Dan Christian Bogos
parent ade725f667
commit 902a411295
3 changed files with 7 additions and 4 deletions

View File

@@ -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

View File

@@ -356,8 +356,8 @@
// // AMQP
// // "consumerTag": "cgrates", // the ID of the consumer
// // "sqlExchange": "",
// // "sqlExchangeType": "",
// // "amqpExchange": "",
// // "amqpExchangeType": "",
// // "amqpRoutingKey": "",
// // "exchangeProcessed": "",

View File

@@ -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()
}