Update rest of config with the new EventExporter

This commit is contained in:
TeoV
2020-07-16 16:13:01 +03:00
committed by Dan Christian Bogos
parent 3faa3a10f4
commit 8c47c6f6d8
12 changed files with 442 additions and 340 deletions

View File

@@ -169,7 +169,7 @@ func testApierLoadConfig(t *testing.T) {
}
func testApierCreateDirs(t *testing.T) {
for _, pathDir := range []string{cfg.CdreProfiles[utils.MetaDefault].ExportPath, "/var/log/cgrates/ers/in", "/var/log/cgrates/ers/out"} {
for _, pathDir := range []string{"/var/log/cgrates/ers/in", "/var/log/cgrates/ers/out"} {
if err := os.RemoveAll(pathDir); err != nil {
t.Fatal("Error removing folder: ", pathDir, err)
}

View File

@@ -51,34 +51,6 @@ func TestMfGeneralItems(t *testing.T) {
}
}
func TestMfCdreDefaultInstance(t *testing.T) {
for _, prflName := range []string{utils.MetaDefault, "export1"} {
if _, hasIt := mfCgrCfg.CdreProfiles[prflName]; !hasIt {
t.Error("Cdre does not contain profile ", prflName)
}
}
prfl := utils.MetaDefault
if mfCgrCfg.CdreProfiles[prfl].ExportFormat != utils.MetaFileCSV {
t.Error("Default instance has cdrFormat: ", mfCgrCfg.CdreProfiles[prfl].ExportFormat)
}
if len(mfCgrCfg.CdreProfiles[prfl].Fields) != 11 {
t.Error("Default instance has number of content fields: ", len(mfCgrCfg.CdreProfiles[prfl].Fields))
}
}
func TestMfCdreExport1Instance(t *testing.T) {
prfl := "export1"
if mfCgrCfg.CdreProfiles[prfl].ExportFormat != utils.MetaFileCSV {
t.Error("Export1 instance has cdrFormat: ", mfCgrCfg.CdreProfiles[prfl].ExportFormat)
}
if len(mfCgrCfg.CdreProfiles[prfl].Fields) != 9 {
t.Error("Export1 instance has number of content fields: ", len(mfCgrCfg.CdreProfiles[prfl].Fields))
}
if mfCgrCfg.CdreProfiles[prfl].Fields[2].Tag != "*exp.Account" {
t.Error("Unexpected headerField value: ", mfCgrCfg.CdreProfiles[prfl].Fields[2].Tag)
}
}
func TestMfEnvReaderITRead(t *testing.T) {
expected := GeneralCfg{
NodeID: "d80fac5",

View File

@@ -33,109 +33,140 @@
"chargers_conns":["*internal"],
"rals_conns": ["*internal"],
"online_cdr_exports": ["http_localhost", "amqp_localhost", "http_test_file", "amqp_test_file","aws_test_file","sqs_test_file","kafka_localhost","s3_test_file", "eventcost_filter"],
"ees_conns": ["*localhost"]
},
"chargers": {
"enabled": true,
},
"attributes": {
"enabled": true,
},
"cdre": {
"http_localhost": {
"export_format": "*http_post",
"export_path": "http://127.0.0.1:12080/cdr_http",
"fields": [ // template of the exported content fields
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
{"path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"path": "*exp.OriginHost", "type": "*variable", "value": "~*req.OriginHost"},
{"path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
{"path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
{"path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost"},
],
},
"amqp_localhost": {
"export_format": "*amqp_json_map",
"export_path": "amqp://guest:guest@localhost:5672/?queue_id=cgrates_cdrs&exchange=exchangename&exchange_type=fanout&routing_key=cgr_cdrs",
"attempts": 3,
"fields": [ // template of the exported content fields
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
{"path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"path": "*exp.OriginHost", "type": "*variable", "value": "~*req.OriginHost"},
{"path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
{"path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
{"path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost"},
],
},
"http_test_file": {
"export_format": "*http_post",
"export_path": "http://127.0.0.1:12080/invalid",
"fields": [
{"path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
],
},
"aws_test_file": {
"export_format": "*amqpv1_json_map",
"export_path": "amqps://guest:guest@localhost:25672/?queue_id=cgrates_cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"sqs_test_file": {
"export_format": "*sqs_json_map",
// export_path for sqs: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://sqs.eu-west-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"amqp_test_file": {
"export_format": "*amqp_json_map",
"export_path": "amqp://guest:guest@localhost:25672/?queue_id=cgrates_cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"kafka_localhost": {
"export_format": "*kafka_json_map",
"export_path": "localhost:9092?topic=cgrates_cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"s3_test_file": {
"export_format": "*s3_json_map",
// export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"eventcost_filter": {
"export_format": "*amqp_json_map",
"export_path": "amqp://guest:guest@wrongurl:25672/?queue_id=cgrates_cdrs",
"filters":["*string:~*ec.Cost:100"],
"fields": [
{"path": "*exp.CGRID", "type": "*composed", "value": "~*req.CGRID"},
],
},
"ees": {
"enabled": true,
"exporters": [
{
"id": "http_localhost",
"type": "*http_post",
"export_path": "http://127.0.0.1:12080/cdr_http",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
{"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"tag": "Category", "path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
{"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime"},
{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime"},
{"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"},
],
},
{
"id": "amqp_localhost",
"type": "*amqp_json_map",
"export_path": "amqp://guest:guest@localhost:5672/?queue_id=cgrates_cdrs&exchange=exchangename&exchange_type=fanout&routing_key=cgr_cdrs",
"tenant": "cgrates.org",
"attempts": 3,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
{"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"tag": "Category", "path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
{"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime"},
{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime"},
{"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"},
],
},
{
"id": "http_test_file",
"type": "*http_post",
"export_path": "http://127.0.0.1:12080/invalid",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
],
},
{
"id": "aws_test_file",
"type": "*amqpv1_json_map",
"export_path": "amqps://guest:guest@localhost:25672/?queue_id=cgrates_cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
],
},
{
"id": "sqs_test_file",
"type": "*sqs_json_map",
// export_path for sqs: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://sqs.eu-west-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
],
},
{
"id": "amqp_test_file",
"type": "*amqp_json_map",
"export_path": "amqp://guest:guest@localhost:25672/?queue_id=cgrates_cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
],
},
{
"id": "kafka_localhost",
"type": "*kafka_json_map",
"export_path": "localhost:9092?topic=cgrates_cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
],
},
{
"id": "s3_test_file",
"type": "*s3_json_map",
// export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
],
},
{
"id": "eventcost_filter",
"type": "*amqp_json_map",
"export_path": "amqp://guest:guest@wrongurl:25672/?queue_id=cgrates_cdrs",
"tenant": "cgrates.org",
"filters":["*string:~*ec.Cost:100"],
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
],
}
],
},

View File

@@ -31,109 +31,141 @@
"chargers_conns":["*internal"],
"rals_conns": ["*internal"],
"online_cdr_exports": ["http_localhost", "amqp_localhost", "http_test_file", "amqp_test_file","aws_test_file","sqs_test_file","kafka_localhost","s3_test_file", "eventcost_filter"],
"ees_conns": ["*localhost"]
},
"chargers": {
"enabled": true,
},
"attributes": {
"enabled": true,
},
"cdre": {
"http_localhost": {
"export_format": "*http_post",
"export_path": "http://127.0.0.1:12080/cdr_http",
"fields": [ // template of the exported content fields
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
{"path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"path": "*exp.OriginHost", "type": "*variable", "value": "~*req.OriginHost"},
{"path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
{"path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
{"path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost"},
],
},
"amqp_localhost": {
"export_format": "*amqp_json_map",
"export_path": "amqp://guest:guest@localhost:5672/?queue_id=cgrates_cdrs&exchange=exchangename&exchange_type=fanout&routing_key=cgr_cdrs",
"attempts": 3,
"fields": [ // template of the exported content fields
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
{"path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"path": "*exp.OriginHost", "type": "*variable", "value": "~*req.OriginHost"},
{"path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
{"path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
{"path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"},
{"path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost"},
],
},
"http_test_file": {
"export_format": "*http_post",
"export_path": "http://127.0.0.1:12080/invalid",
"fields": [
{"path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
],
},
"aws_test_file": {
"export_format": "*amqpv1_json_map",
"export_path": "amqps://guest:guest@localhost:25672/?queue_id=cgrates_cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"sqs_test_file": {
"export_format": "*sqs_json_map",
// export_path for sqs: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://sqs.eu-west-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"amqp_test_file": {
"export_format": "*amqp_json_map",
"export_path": "amqp://guest:guest@localhost:25672/?queue_id=cgrates_cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"kafka_localhost": {
"export_format": "*kafka_json_map",
"export_path": "localhost:9092?topic=cgrates_cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"s3_test_file": {
"export_format": "*s3_json_map",
// export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"eventcost_filter": {
"export_format": "*amqp_json_map",
"export_path": "amqp://guest:guest@wrongurl:25672/?queue_id=cgrates_cdrs",
"filters":["*string:~*ec.Cost:100"],
"fields": [
{"path": "*exp.CGRID", "type": "*composed", "value": "~*req.CGRID"},
],
},
"ees": {
"enabled": true,
"exporters": [
{
"id": "http_localhost",
"type": "*http_post",
"export_path": "http://127.0.0.1:12080/cdr_http",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
{"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"tag": "Category", "path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
{"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime"},
{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime"},
{"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"},
],
},
{
"id": "amqp_localhost",
"type": "*amqp_json_map",
"export_path": "amqp://guest:guest@localhost:5672/?queue_id=cgrates_cdrs&exchange=exchangename&exchange_type=fanout&routing_key=cgr_cdrs",
"tenant": "cgrates.org",
"attempts": 3,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
{"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"tag": "Category", "path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
{"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime"},
{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime"},
{"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"},
],
},
{
"id": "http_test_file",
"type": "*http_post",
"export_path": "http://127.0.0.1:12080/invalid",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
],
},
{
"id": "aws_test_file",
"type": "*amqpv1_json_map",
"export_path": "amqps://guest:guest@localhost:25672/?queue_id=cgrates_cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
],
},
{
"id": "sqs_test_file",
"type": "*sqs_json_map",
// export_path for sqs: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://sqs.eu-west-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
],
},
{
"id": "amqp_test_file",
"type": "*amqp_json_map",
"export_path": "amqp://guest:guest@localhost:25672/?queue_id=cgrates_cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
],
},
{
"id": "kafka_localhost",
"type": "*kafka_json_map",
"export_path": "localhost:9092?topic=cgrates_cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
],
},
{
"id": "s3_test_file",
"type": "*s3_json_map",
// export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
],
},
{
"id": "eventcost_filter",
"type": "*amqp_json_map",
"export_path": "amqp://guest:guest@wrongurl:25672/?queue_id=cgrates_cdrs",
"tenant": "cgrates.org",
"filters":["*string:~*ec.Cost:100"],
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"}
],
}
],
},

View File

@@ -27,18 +27,27 @@
"attributes_conns": ["*internal"],
},
"cdre":{
"aws_test_file": {
"export_format": "*amqp_json_map",
"export_path": "amqps://guest:guest@localhost:256733/",
"attempts": 1, // export attempts
"synchronous": true, // block processing until export has a result
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"ees": {
"enabled": true,
"attributes_conns": ["*internal"],
"exporters": [
{
"id": "aws_test_file",
"export_format": "*amqp_json_map",
"export_path": "amqps://guest:guest@localhost:256733/",
"tenant": "cgrates.org",
"attempts": 1,
"synchronous": true,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
}
]
},
"stats": {
"enabled": true,
"store_interval": "-1",
@@ -67,6 +76,7 @@
"stats_conns": ["*internal"],
"thresholds_conns": ["*internal"],
"online_cdr_exports": ["aws_test_file"],
"ees_conns": ["*localhost"]
},

View File

@@ -31,16 +31,22 @@
"attributes_conns": ["*internal"],
},
"cdre":{
"aws_test_file": {
"export_format": "*amqp_json_map",
"export_path": "amqps://guest:guest@localhost:256733/",
"attempts": 1, // export attempts
"synchronous": true, // block processing until export has a result
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"ees": {
"enabled": true,
"attributes_conns": ["*internal"],
"exporters": [
{
"id": "aws_test_file",
"export_format": "*amqp_json_map",
"export_path": "amqps://guest:guest@localhost:256733/",
"tenant": "cgrates.org",
"attempts": 1,
"synchronous": true,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
}
]
},
"stats": {
@@ -71,6 +77,7 @@
"stats_conns": ["*internal"],
"thresholds_conns": ["*internal"],
"online_cdr_exports": ["aws_test_file"],
"ees_conns": ["*localhost"]
},

View File

@@ -28,18 +28,25 @@
"attributes_conns": ["*internal"],
},
"cdre":{
"aws_test_file": {
"export_format": "*amqp_json_map",
"export_path": "amqps://guest:guest@localhost:256733/",
"attempts": 1, // export attempts
"synchronous": true, // block processing until export has a result
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"ees": {
"enabled": true,
"attributes_conns": ["*internal"],
"exporters": [
{
"id": "aws_test_file",
"export_format": "*amqp_json_map",
"export_path": "amqps://guest:guest@localhost:256733/",
"tenant": "cgrates.org",
"attempts": 1,
"synchronous": true,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
}
]
},
"stats": {
"enabled": true,
"store_interval": "-1",
@@ -68,6 +75,7 @@
"stats_conns": ["*internal"],
"thresholds_conns": ["*internal"],
"online_cdr_exports": ["aws_test_file"],
"ees_conns": ["*localhost"]
},

View File

@@ -32,6 +32,7 @@
"stats_conns": ["*localhost"],
"thresholds_conns": ["*localhost"],
"online_cdr_exports": ["s3_test_file"],
"ees_conns": ["*localhost"]
},
"attributes": {
@@ -59,16 +60,22 @@
"scheduler_conns": ["*internal"],
},
"cdre": {
"s3_test_file": {
"export_format": "*s3_json_map",
// export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"fields": [
{"path": "*expCGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"ees": {
"enabled": true,
"attributes_conns": ["*internal"],
"exporters": [
{
"id": "s3_test_file",
"export_format": "*s3_json_map",
// export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
}
]
},
}

View File

@@ -41,6 +41,7 @@
"stats_conns": ["*localhost"],
"thresholds_conns": ["*localhost"],
"online_cdr_exports": ["s3_test_file"],
"ees_conns": ["*localhost"]
},
"attributes": {
@@ -68,16 +69,26 @@
"scheduler_conns": ["*internal"],
},
"cdre": {
"s3_test_file": {
"export_format": "*s3_json_map",
// export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"ees": {
"enabled": true,
"attributes_conns": ["*internal"],
"exporters": [
{
"id": "s3_test_file",
"export_format": "*s3_json_map",
// export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
}
]
},
}

View File

@@ -7,28 +7,28 @@
"general": {
"log_level": 7,
"poster_attempts": 1, // number of attempts before considering post request failed (eg: *http_post, CDR exports)
"failed_posts_ttl": "1s", // time to wait before writing the failed posts in a single file
"failed_posts_ttl": "1s" // time to wait before writing the failed posts in a single file
},
"data_db": { // database used to store runtime data (eg: accounts, cdr stats)
"db_type": "redis", // data_db type: <redis|mongo>
"db_port": 6379, // data_db port to reach the database
"db_name": "10", // data_db database name to connect to
"db_name": "10" // data_db database name to connect to
},
"stor_db": {
"db_password": "CGRateS.org",
"db_password": "CGRateS.org"
},
"rals": {
"enabled": true, // enable Rater service: <true|false>
"thresholds_conns": ["*localhost"],
"thresholds_conns": ["*localhost"]
},
"schedulers": {
"enabled": true,
"enabled": true
},
"cdrs": {
@@ -39,43 +39,51 @@
"stats_conns": ["*localhost"],
"thresholds_conns": ["*localhost"],
"online_cdr_exports": ["s3_test_file"],
"ees_conns": ["*localhost"]
},
"attributes": {
"enabled": true,
"enabled": true
},
"stats": {
"enabled": true,
"store_interval": "1s",
"thresholds_conns": ["*internal"],
"thresholds_conns": ["*internal"]
},
"thresholds": {
"enabled": true,
"store_interval": "1s",
"store_interval": "1s"
},
"chargers": {
"enabled": true,
"attributes_conns": ["*internal"],
"attributes_conns": ["*internal"]
},
"apiers": {
"enabled": true,
"scheduler_conns": ["*internal"],
"scheduler_conns": ["*internal"]
},
"cdre": {
"s3_test_file": {
"export_format": "*s3_json_map",
// export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
},
"ees": {
"enabled": true,
"attributes_conns": ["*internal"],
"exporters": [
{
"id": "s3_test_file",
"export_format": "*s3_json_map",
// export_path for s3: "endpoint?aws_region=region&aws_key=IDkey&aws_secret=secret&aws_token=sessionToken&queue_id=cgrates-cdrs"
"export_path": "http://s3.us-east-2.amazonaws.com/?aws_region=eu-west-2&aws_key=testkey&aws_secret=testsecret&queue_id=cgrates-cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
],
}
]
},
}
},

View File

@@ -47,34 +47,42 @@
"extra_fields": ["PayPalAccount", "LCRProfile", "ResourceID"],
"chargers_conns":["*localhost"],
"store_cdrs": true,
"online_cdr_exports": []
"online_cdr_exports": [],
"ees_conns": ["*localhost"]
},
"cdre": {
"amqp_localhost": {
"export_format": "*amqp_json_map",
"export_path": "amqp://guest:guest@localhost:5672/?queue_id=cgrates_cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
{"path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"path": "*exp.OriginHost", "type": "*variable", "value": "~*req.OriginHost"},
{"path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType", },
{"path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime"},
{"path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime"},
{"path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost"},
{"path": "*exp.PayPalAccount", "type": "*variable", "value": "~*req.PayPalAccount"},
{"path": "*exp.LCRProfile", "type": "*variable", "value": "~*req.LCRProfile", },
{"path": "*exp.ResourceID", "type": "*variable", "value": "~*req.ResourceID", },
],
},
"ees": {
"enabled": true,
"attributes_conns":["*internal"],
"exporters": [
{
"id": "amqp_localhost",
"type": "*amqp_json_map",
"export_path": "amqp://guest:guest@localhost:5672/?queue_id=cgrates_cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
{"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"tag": "Category", "path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
{"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime"},
{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime"},
{"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"},
{"tag": "PayPalAccount", "path": "*exp.PayPalAccount", "type": "*variable", "value": "~*req.PayPalAccount"},
{"tag": "LCRProfile", "path": "*exp.LCRProfile", "type": "*variable", "value": "~*req.LCRProfile"},
{"tag": "ResourceID", "path": "*exp.ResourceID", "type": "*variable", "value": "~*req.ResourceID"}
],
},
],
},

View File

@@ -54,34 +54,42 @@
"extra_fields": ["PayPalAccount", "LCRProfile", "ResourceID"],
"chargers_conns":["conn1"],
"store_cdrs": true,
"online_cdr_exports": []
"online_cdr_exports": [],
"ees_conns": ["*localhost"]
},
"cdre": {
"amqp_localhost": {
"export_format": "*amqp_json_map",
"export_path": "amqp://guest:guest@localhost:5672/?queue_id=cgrates_cdrs",
"fields": [
{"path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
{"path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"path": "*exp.OriginHost", "type": "*variable", "value": "~*req.OriginHost"},
{"path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType", },
{"path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime"},
{"path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime"},
{"path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost"},
{"path": "*exp.PayPalAccount", "type": "*variable", "value": "~*req.PayPalAccount"},
{"path": "*exp.LCRProfile", "type": "*variable", "value": "~*req.LCRProfile", },
{"path": "*exp.ResourceID", "type": "*variable", "value": "~*req.ResourceID", },
],
},
"ees": {
"enabled": true,
"attributes_conns":["*internal"],
"exporters": [
{
"id": "amqp_localhost",
"type": "*amqp_json_map",
"export_path": "amqp://guest:guest@localhost:5672/?queue_id=cgrates_cdrs",
"tenant": "cgrates.org",
"attempts": 1,
"fields":[
{"tag": "CGRID", "path": "*exp.CGRID", "type": "*variable", "value": "~*req.CGRID"},
{"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"},
{"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"},
{"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"},
{"tag": "RequestType", "path": "*exp.RequestType", "type": "*variable", "value": "~*req.RequestType"},
{"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"},
{"tag": "Category", "path": "*exp.Category", "type": "*variable", "value": "~*req.Category"},
{"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"},
{"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject"},
{"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination"},
{"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime"},
{"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime"},
{"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"},
{"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"},
{"tag": "PayPalAccount", "path": "*exp.PayPalAccount", "type": "*variable", "value": "~*req.PayPalAccount"},
{"tag": "LCRProfile", "path": "*exp.LCRProfile", "type": "*variable", "value": "~*req.LCRProfile"},
{"tag": "ResourceID", "path": "*exp.ResourceID", "type": "*variable", "value": "~*req.ResourceID"}
],
},
],
},