{ // Sample CGRateS Configuration file for EEs // // Copyright (C) ITsysCOM GmbH "logger": { "type": "*syslog", // controls the destination of logs <*syslog|*stdout|*kafka> "level": 7, // system level precision for floats }, "listen": { "rpc_json": ":2012", "rpc_gob": ":2013", "http": ":2080", }, "data_db": { "db_type": "redis", "db_port": 6379, "db_name": "10", }, "cdrs": { "enabled": true, "chargers_conns": ["*localhost"], "rates_conns": ["*internal"], "session_cost_retries": 0, }, "chargers": { "enabled": true, "attributes_conns": ["*internal"], }, "attributes": { "enabled": true, }, "ees": { "enabled": true, "attributes_conns":["*internal"], "cache": { "*fileCSV": {"limit": -1, "ttl": "500ms", "static_ttl": false}, "*fileFWV": {"limit": -1, "ttl": "500ms", "static_ttl": false} }, "exporters": [ { "id": "CSVExporter", "type": "*fileCSV", "export_path": "/tmp/testCSV", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, "field_separator": ",", }, { "id": "CSVExporterComposed", "type": "*fileCSV", "export_path": "/tmp/testComposedCSV", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, "field_separator": ",", "fields":[ {"tag": "Number", "path": "*hdr.Number", "type": "*constant", "value": "NumberOfEvent"}, {"tag": "*originID", "path": "*hdr.*originID", "type": "*constant", "value": "*originID"}, {"tag": "RunID", "path": "*hdr.RunID", "type": "*constant", "value": "RunID"}, {"tag": "ToR", "path": "*hdr.ToR", "type": "*constant", "value": "ToR"}, {"tag": "OriginID", "path": "*hdr.OriginID", "type": "*constant", "value": "OriginID"}, {"tag": "RequestType", "path": "*hdr.RequestType", "type": "*constant", "value": "RequestType"}, {"tag": "Tenant", "path": "*hdr.Tenant", "type": "*constant", "value": "Tenant"}, {"tag": "Category", "path": "*hdr.Category", "type": "*constant", "value": "Category"}, {"tag": "Account", "path": "*hdr.Account", "type": "*constant", "value": "Account"}, {"tag": "Subject", "path": "*hdr.Subject", "type": "*constant", "value": "Subject"}, {"tag": "Destination", "path": "*hdr.Destination", "type": "*constant", "value": "Destination"}, {"tag": "SetupTime", "path": "*hdr.SetupTime", "type": "*constant", "value": "SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "AnswerTime", "path": "*hdr.AnswerTime", "type": "*constant", "value": "AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "Usage", "path": "*hdr.Usage", "type": "*constant", "value": "Usage"}, {"tag": "Cost", "path": "*hdr.Cost", "type": "*constant", "value": "Cost"}, {"tag": "Number", "path": "*exp.Number", "type": "*variable", "value": "~*dc.NumberOfEvents"}, {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, {"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"}, {"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"}, {"tag": "OriginID1", "path": "*exp.OriginID", "type": "*composed", "value": "~*req.ComposedOriginID1"}, {"tag": "OriginID2", "path": "*exp.OriginID", "type": "*composed", "value": "~*req.ComposedOriginID2"}, {"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", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"}, {"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"}, {"tag": "NumberOfEvents", "path": "*trl.NumberOfEvents", "type": "*variable", "value": "~*dc.NumberOfEvents"}, {"tag": "TotalDuration", "path": "*trl.TotalDuration", "type": "*variable", "value": "~*dc.TotalDuration"}, {"tag": "TotalSMSUsage", "path": "*trl.TotalSMSUsage", "type": "*variable", "value": "~*dc.TotalSMSUsage"}, {"tag": "TotalCost", "path": "*trl.TotalCost", "type": "*variable", "value": "~*dc.TotalCost{*round:4}"}, ], }, { "id": "CSVExporterBuffered", "type": "*fileCSV", "export_path": "*buffer", "filters": ["*string:~*req.Account:1005"], "attempts": 1, "field_separator": ",", "synchronous": true, "fields":[ {"tag": "Number", "path": "*hdr.Number", "type": "*constant", "value": "NumberOfEvent"}, {"tag": "*originID", "path": "*hdr.*originID", "type": "*constant", "value": "*originID"}, {"tag": "RunID", "path": "*hdr.RunID", "type": "*constant", "value": "RunID"}, {"tag": "ToR", "path": "*hdr.ToR", "type": "*constant", "value": "ToR"}, {"tag": "OriginID", "path": "*hdr.OriginID", "type": "*constant", "value": "OriginID"}, {"tag": "RequestType", "path": "*hdr.RequestType", "type": "*constant", "value": "RequestType"}, {"tag": "Tenant", "path": "*hdr.Tenant", "type": "*constant", "value": "Tenant"}, {"tag": "Category", "path": "*hdr.Category", "type": "*constant", "value": "Category"}, {"tag": "Account", "path": "*hdr.Account", "type": "*constant", "value": "Account"}, {"tag": "Subject", "path": "*hdr.Subject", "type": "*constant", "value": "Subject"}, {"tag": "Destination", "path": "*hdr.Destination", "type": "*constant", "value": "Destination"}, {"tag": "SetupTime", "path": "*hdr.SetupTime", "type": "*constant", "value": "SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "AnswerTime", "path": "*hdr.AnswerTime", "type": "*constant", "value": "AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "Usage", "path": "*hdr.Usage", "type": "*constant", "value": "Usage"}, {"tag": "Cost", "path": "*hdr.Cost", "type": "*constant", "value": "Cost"}, {"tag": "Number", "path": "*exp.Number", "type": "*variable", "value": "~*dc.NumberOfEvents"}, {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, {"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"}, {"tag": "ToR", "path": "*exp.ToR", "type": "*constant", "value": ""}, {"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"}, {"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": ""}, {"tag": "OriginID1", "path": "*exp.OriginID", "type": "*composed", "value": "~*req.ComposedOriginID1"}, {"tag": "OriginID2", "path": "*exp.OriginID", "type": "*composed", "value": "~*req.ComposedOriginID2"}, {"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", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"}, {"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"}, {"tag": "NumberOfEvents", "path": "*trl.NumberOfEvents", "type": "*variable", "value": "~*dc.NumberOfEvents"}, {"tag": "TotalDuration", "path": "*trl.TotalDuration", "type": "*variable", "value": "~*dc.TotalDuration"}, {"tag": "TotalSMSUsage", "path": "*trl.TotalSMSUsage", "type": "*variable", "value": "~*dc.TotalSMSUsage"}, {"tag": "TotalCost", "path": "*trl.TotalCost", "type": "*variable", "value": "~*dc.TotalCost{*round:4}"}, ], }, { "id": "FwvExporter", "type": "*fileFWV", "export_path": "/tmp/testFWV", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, "fields":[ {"tag": "TypeOfRecord", "path": "*hdr.TypeOfRecord", "type": "*constant", "value": "10", "width": 2}, {"tag": "Filler1", "path": "*hdr.Filler1", "type": "*filler", "width": 3}, {"tag": "DistributorCode", "path": "*hdr.DistributorCode", "type": "*constant", "value": "VOI","width": 3}, {"tag": "FileCreationTime", "path": "*hdr.FileCreationTime", "type": "*variable","value":"~*dc.TimeNow{*time_string:020106150400}", "width": 12 }, {"tag": "FileVersion", "path": "*hdr.FileVersion", "type": "*constant", "value": "01","width": 2}, {"tag": "Filler2", "path": "*hdr.Filler2", "type": "*filler", "width": 105}, {"tag": "TypeOfRecord", "path": "*exp.TypeOfRecord", "type": "*constant", "value": "20","width": 2}, {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account","width": 12,"strip": "*left","padding": "*right"}, {"tag": "Subject", "path": "*exp.Subject", "type": "*variable", "value": "~*req.Subject","width": 5,"strip": "*left","padding": "*right"}, {"tag": "CLI", "path": "*exp.CLI", "type": "*constant", "value": "cli","width": 15,"strip": "*xright","padding": "*right"}, {"tag": "Destination", "path": "*exp.Destination", "type": "*variable", "value": "~*req.Destination","width": 24,"strip": "*xright","padding": "*right"}, {"tag": "ToR", "path": "*exp.ToR", "type": "*constant", "value": "02","width": 2}, {"tag": "SubtypeTOR", "path": "*exp.SubtypeTOR", "type": "*constant", "value": "11", "width": 4, "padding": "*right"}, {"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime{*time_string:020106150400}", "width": 12, "padding": "*right","strip": "*right"}, {"tag": "Duration", "path": "*exp.Duration", "type": "*variable", "value": "~*req.Usage", "width": 6, "strip": "*right","padding": "*right","layout": "seconds"}, {"tag": "DataVolume", "path": "*exp.DataVolume", "type": "*filler","width": 6}, {"tag": "TaxCode", "path": "*exp.TaxCode", "type": "*constant","value":"1","width": 1}, {"tag": "OperatorCode", "path": "*exp.OperatorCode", "type": "*constant","value":"opercode", "width": 2, "strip": "*right", "padding": "*right"}, {"tag": "ProductId", "path": "*exp.ProductId", "type": "*variable","value":"~*req.ProductId", "width": 5, "strip": "*right", "padding": "*right"}, {"tag": "NetworkId", "path": "*exp.NetworkId", "type": "*constant","value":"3", "width": 1}, {"tag": "CallId", "path": "*exp.CallId", "type": "*variable","value":"~*req.OriginID", "width": 16, "padding": "*right"}, {"tag": "Filler1", "path": "*exp.Filler1", "type": "*filler", "width": 8}, {"tag": "Filler2", "path": "*exp.Filler2", "type": "*filler", "width": 8}, {"tag": "TerminationCode", "path": "*exp.TerminationCode", "type": "*variable", "value":"~*req.Operator;~*req.Product", "width": 5,"strip": "*right","padding": "*right"}, {"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:5}", "width": 9, "padding": "*zeroleft"}, {"tag": "DestinationPrivacy", "path": "*exp.DestinationPrivacy", "type": "*masked_destination", "width": 1}, {"tag": "TypeOfRecord", "path": "*trl.TypeOfRecord", "type": "*constant", "value": "90", "width": 2}, {"tag": "Filler1", "path": "*trl.Filler1", "type": "*filler", "width": 3}, {"tag": "DistributorCode", "path": "*trl.DistributorCode", "type": "*constant", "value": "VOI","width": 3}, {"tag": "NumberOfRecords", "path": "*trl.NumberOfRecords", "type": "*variable", "value": "~*dc.NumberOfEvents","width": 6,"padding": "*zeroleft"}, {"tag": "CdrsDuration", "path": "*trl.CdrsDuration", "type": "*variable", "value": "~*dc.TotalDuration","width": 8,"padding":"*zeroleft","layout": "seconds"}, {"tag": "FirstCdrTime", "path": "*trl.FirstCdrTime", "type": "*variable", "value": "~*dc.FirstEventATime{*time_string:020106150400}", "width": 12}, {"tag": "LastCdrTime", "path": "*hdr.LastCdrTime", "type": "*variable", "value": "~*dc.LastEventATime{*time_string:020106150400}", "width": 12,}, {"tag": "Filler2", "path": "*trl.Filler2", "type": "*filler", "width": 93} ], }, { "id": "HTTPPostExporter", "type": "*httpPost", "export_path": "http://127.0.0.1:12080/event_http", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, "fields":[ {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, {"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": "HTTPHeader", "path": "*hdr.Origin", "type": "*constant", "value": "http://www.cgrates.org"}, ], }, { "id": "HTTPJsonMapExporter", "type": "*httpJSONMap", "export_path": "http://127.0.0.1:12081/event_json_map_http", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, "fields":[ {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, {"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": "EvenType", "path": "*exp.EventType", "type": "*variable", "value": "~*opts.*eventType"}, {"tag": "HTTPHeader", "path": "*hdr.Origin", "type": "*constant", "value": "http://www.cgrates.org"}, ], }, { "id": "CSVMaskedDestination", "type": "*fileCSV", "export_path": "/tmp/testCSVMasked", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, "field_separator": ",", "fields":[ {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, {"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": "*masked_destination", "value": "~*req.Destination", "mask_destinationd_id": "MASKED_DESTINATIONS", "mask_length": 3}, {"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"}, {"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"}, ], }, { "id": "RouteExporter", // this exporter will set the Cost Account and RunID in cache so we can use it in other exports "type": "*virt", "attempts": 1, "fields":[ {"tag": "Cost", "path": "*uch.<~*opts.*originID;~*req.RunID;-Cost>", "type": "*variable", "value": "~*req.Cost", "rounding_decimals": 4}, {"tag": "Account", "path": "*uch.<~*opts.*originID;~*req.RunID;-Account>", "type": "*variable", "value": "~*req.Account"}, {"tag": "RunID", "path": "*uch.<~*opts.*originID;~*req.RunID;-RunID>", "type": "*variable", "value": "~*req.RunID"}, {"tag": "CustomVariable", "path": "*uch.<~*opts.*originID;~*req.RunID;-CustomVariable>", "type": "*variable", "value": "CustomValue"} ], }, { "id": "CSVExporterFromVirt", "type": "*fileCSV", "export_path": "/tmp/testCSVfromVirt", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, "field_separator": ",", "fields":[ {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, {"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"}, {"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"}, {"tag": "Tenant", "path": "*exp.Tenant", "type": "*variable", "value": "~*req.Tenant"}, {"tag": "Account", "path": "*exp.Account", "type": "*variable", "value": "~*req.Account"}, {"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost", "rounding_decimals": 4}, {"tag": "SupplierCustomVariable","filters": ["*exists:~*uch.<~*opts.*originID;~*req.RunID;-CustomVariable>:"], "path": "*exp.SupplierCustomVariable", "type": "*variable", "value": "~*uch.<`~*opts.*originID;~*req.RunID;-CustomVariable`>"}, {"tag": "SupplierCost","filters": ["*exists:~*uch.<~*opts.*originID;~*req.RunID;-Cost>:"], "path": "*exp.SupplierCost", "type": "*variable", "value": "~*uch.<`~*opts.*originID;~*req.RunID;-Cost`>"}, {"tag": "SupplierRun","filters": ["*exists:~*uch.<~*opts.*originID;~*req.RunID;-RunID>:"], "path": "*exp.SupplierRun", "type": "*variable", "value": "~*uch.<`~*opts.*originID;~*req.RunID;-RunID`>"}, ], }, { "id": "CSVExporterWIthTemplate", "type": "*fileCSV", "export_path": "/tmp/testCSVExpTemp", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, "field_separator": ",", "fields":[ {"tag": "RequiredTemplate","type": "*template", "value": "requiredFields"}, ], }, { "id": "ElasticsearchExporter", "type": "*els", "export_path": "http://localhost:9200", "attempts": 1, "opts": { "elsIndex": "cdrs", //"elsIfPrimaryTerm": 0, //"elsIfSeqNo": 0, "elsOpType": "", "elsPipeline": "", // "require_alias": "", "elsRouting": "", "elsTimeout": "0", //"elsVersion": 0, "elsVersionType": "", "elsWaitForActiveShards": "", }, "fields":[ {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, {"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": "HTTPJsonMapExporterWithNoFields", "type": "*httpJSONMap", "export_path": "http://127.0.0.1:12081/event_json_map_http", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, }, { "id": "ElasticExporterWithNoFields", "type": "*els", "export_path": "http://localhost:9200", "attempts": 1, }, { "id": "HTTPPostExporterWithNoFields", "type": "*httpPost", "export_path": "http://127.0.0.1:12080/event_http", "flags": ["*attributes"], "attribute_context": "customContext", "attempts": 1, }, { "id": "SQLExporterFull", "type": "*sql", "export_path": "mysql://cgrates:CGRateS.org@127.0.0.1:3306", "attempts": 1, "opts": { "sqlDBName": "cgrates2", // if dbName is not present "cgrates" will be used as default "sqlTableName": "expTable", // tableName is mandatory in opts for sql exporter "pgSSLMode": "disable", "sqlMaxIdleConns": 10, "sqlMaxOpenConns": 100, "sqlConnMaxLifetime": "0", "mysqlDSNParams": { "allowOldPasswords": "true", "allowNativePasswords": "true", }, }, "fields":[ // in case that the path is *exp.*row user must complete all the fields one to one with his sql schema in the correct order {"tag": "*originID", "path": "*exp.*row", "type": "*group", "value": "~*opts.*originID"}, {"tag": "AnswerTime", "path": "*exp.*row", "type": "*group", "value": "~*req.AnswerTime"}, {"tag": "Usage", "path": "*exp.*row", "type": "*group", "value": "~*req.Usage"}, {"tag": "Cost", "path": "*exp.*row", "type": "*group", "value": "~*req.Cost{*round:4}"}, ] }, { "id": "SQLExporterPartial", "type": "*sql", "export_path": "mysql://cgrates:CGRateS.org@127.0.0.1:3306", "attempts": 1, "opts": { "sqlDBName": "cgrates2", "sqlTableName": "expTable", "pgSSLMode": "disable", "sqlMaxIdleConns": 10, "sqlMaxOpenConns": 100, "sqlConnMaxLifetime": "0", }, "fields":[ // the path constains *exp.columnName {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, {"tag": "AnswerTime", "path": "*exp.answer_time", "type": "*variable", "value": "~*req.AnswerTime"}, {"tag": "Cost", "path": "*exp.cost", "type": "*variable", "value": "~*req.Cost{*round:4}"}, {"tag": "Usage", "path": "*exp.`usage`", "type": "*variable", "value": "~*req.Usage"}, ] }, { "id": "NatsJsonMapExporter", "type": "*natsJSONMap", "export_path": "nats://localhost:4222", "attempts": 1, "opts": { "natsJetStream": true, "natsSubject": "processed_cdrs", } }, { "id": "NatsJsonMapExporter2", "type": "*natsJSONMap", "export_path": "nats://localhost:4222", "attempts": 1, "opts": { "natsSubject": "processed_cdrs", } }, { "id": "SQLExportCDR", "type": "*sql", "export_path": "mysql://cgrates:CGRateS.org@127.0.0.1:3306", "attempts": 1, "opts": { "sqlTableName": "cdrs", // tableName is mandatory in opts for sql exporter }, "fields":[ {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, {"tag": "RunID", "path": "*exp.RunID", "type": "*variable", "value": "~*req.RunID"}, {"tag": "OriginHost", "path": "*exp.OriginHost", "type": "*variable", "value": "~*req.OriginHost"}, {"tag": "Source", "path": "*exp.Source", "type": "*variable", "value": "~*req.Source"}, {"tag": "OriginID", "path": "*exp.OriginID", "type": "*variable", "value": "~*req.OriginID"}, {"tag": "ToR", "path": "*exp.ToR", "type": "*variable", "value": "~*req.ToR"}, {"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": "ExtraInfo", "path": "*exp.ExtraInfo", "type": "*variable", "value": "~*req.ExtraInfo"}, {"tag": "CostSource", "path": "*exp.CostSource", "type": "*variable", "value": "~*req.CostSource"}, {"tag": "SetupTime", "path": "*exp.SetupTime", "type": "*variable", "value": "~*req.SetupTime{*time_string}"}, {"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime{*time_string}"}, {"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage{*duration}"}, {"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*float64}"}, {"tag": "Partial", "path": "*exp.Partial", "type": "*variable", "value": "true","filters": ["*string:~*req.Partial:true"]}, {"tag": "PreRated", "path": "*exp.PreRated", "type": "*variable", "value": "true","filters": ["*string:~*req.PreRated:true"]}, // extra fields {"tag": "Opts", "path": "*opts.ExtraFields.extra1", "type": "*variable", "value": "value"}, // put all the extrafields inside *opts {"tag": "ExtraFields", "path": "*exp.ExtraFields", "type": "*variable", "value": "~*opts.ExtraFields"}, // and then move them to *exp // cost details ?? {"tag": "CostDetails", "path": "*exp.CostDetails", "type": "*variable", "value": "~*req.CostDetails"} ] }, { "id": "KafkaExporter", "type": "*kafkaJSONMap", "export_path": "localhost:9093", "concurrent_requests": 0, "opts": { "kafkaTopic": "cgrates", "kafkaCAPath": "/home/kafka/kafka/ssl/ca-cert.pem" }, "timezone": "", "filters": [], "flags": [], "attribute_ids": [], "attribute_context": "", "synchronous": false, "blocker": false, "attempts": 1, "fields":[], "failed_posts_dir": "/var/spool/cgrates/failed_posts" } ] }, "efs": { // ExportFailover service "enabled": true, // starts the EventReader service: }, "admins": { "enabled": true }, "templates": { "requiredFields": [ {"tag": "*originID", "path": "*exp.*originID", "type": "*variable", "value": "~*opts.*originID"}, {"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", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "AnswerTime", "path": "*exp.AnswerTime", "type": "*variable", "value": "~*req.AnswerTime", "layout": "2006-01-02T15:04:05Z07:00"}, {"tag": "Usage", "path": "*exp.Usage", "type": "*variable", "value": "~*req.Usage"}, {"tag": "Cost", "path": "*exp.Cost", "type": "*variable", "value": "~*req.Cost{*round:4}"} ], }, }