{
"general": {
	"log_level": 7,
},

"apiers": {
	"enabled": true
},
"filters": {			
	"apiers_conns": ["*localhost"]
},
"stor_db": {
	"opts": {
		"sqlConnMaxLifetime": "5s", // needed while running all integration tests
	},
},
"ees": {
	"enabled": true,
	"exporters": [{
		"id": "SQLExporter",
		"type": "*sql",
		"export_path": "mysql://cgrates:CGRateS.org@127.0.0.1:3306",
		"attempts": 1,
		"opts": {
			"sqlDBName": "cgrates2",
			"sqlTableName":"cdrs", 
			"sqlUpdateIndexedFields": ["id", "cgrid"],
		},
		"flags": ["*log"],
		"fields": [
			{"tag": "SetupTime", "path": "*exp.setup_time", "type": "*constant", "value": "2018-11-27 14:21:26"},
			{"tag": "Account", "path": "*exp.account", "type": "*variable", "value": "~*req.ExtraInfo"},
			{"tag": "ID", "path": "*exp.id", "type": "*variable", "value": "~*req.Id"},
			{"tag": "CGRID", "path": "*exp.cgrid", "type": "*variable", "value": "~*req.CGRID"},
		]
	}]
},
"ers": {									
	"enabled": true,						
	"sessions_conns":["*localhost"],
	"ees_conns": ["*localhost"],
	"readers": [{
			"id": "mysql",										
			"type": "*sql",				
			"run_delay": "1m",									
			"source_path": "*mysql://cgrates:CGRateS.org@127.0.0.1:3306",					
			"opts": {
				"sqlDBName":"cgrates2",
				"sqlTableName":"cdrs", 
			},
			"start_delay": "500ms", // wait for db to be populated before starting reader 
			"tenant": "cgrates.org",							
			"filters": [
					"*gt:~*req.answer_time:-168h", // dont process cdrs with answer_time older than 7 days ago 
					"FLTR_SQL_RatingID", // "*eq:~*req.cost_details.Charges[0].RatingID:RatingID2",
					"*string:~*vars.*readerID:mysql",
					"FLTR_VARS", // "*string:~*vars.*readerID:mysql",
			],										
            "ees_ids": ["SQLExporter"],
			"flags": ["*dryrun", "*export"],										
			"fields":[									
				{"tag": "CGRID", "path": "*cgreq.CGRID", "type": "*variable", "value": "~*req.cgrid", "mandatory": true},
				{"tag": "ToR", "path": "*cgreq.ToR", "type": "*variable", "value": "~*req.tor", "mandatory": true},
				{"tag": "OriginID", "path": "*cgreq.OriginID", "type": "*variable", "value": "~*req.origin_id", "mandatory": true},
				{"tag": "RequestType", "path": "*cgreq.RequestType", "type": "*variable", "value": "~*req.request_type", "mandatory": true},
				{"tag": "Tenant", "path": "*cgreq.Tenant", "type": "*variable", "value": "~*req.tenant", "mandatory": true},
				{"tag": "Category", "path": "*cgreq.Category", "type": "*variable", "value": "~*req.category", "mandatory": true},
				{"tag": "Account", "path": "*cgreq.Account", "type": "*variable", "value": "~*req.account", "mandatory": true},
				{"tag": "Subject", "path": "*cgreq.Subject", "type": "*variable", "value": "~*req.subject", "mandatory": true},
				{"tag": "Destination", "path": "*cgreq.Destination", "type": "*variable", "value": "~*req.destination", "mandatory": true},
				{"tag": "SetupTime", "path": "*cgreq.SetupTime", "type": "*variable", "value": "~*req.setup_time", "mandatory": true},
				{"tag": "AnswerTime", "path": "*cgreq.AnswerTime", "type": "*variable", "value": "~*req.answer_time", "mandatory": true},
				{"tag": "CostDetails", "path": "*cgreq.CostDetails", "type": "*variable", "value": "~*req.cost_details", "mandatory": true},
				{"tag": "Usage", "path": "*cgreq.Usage", "type": "*variable", "value": "~*req.usage", "mandatory": true},
				{"tag": "ExtraInfo", "path": "*cgreq.ExtraInfo", "type": "*variable", "value": "~*req.extra_info", "mandatory": true},
				{"tag": "ID", "path": "*cgreq.Id", "type": "*variable", "value": "~*req.id", "mandatory": true},
			],
		},
	],
},

}