{
// CGRateS Configuration file


"general": {
	"reply_timeout": "30s",
},

"logger": {
	"level": 7
},

"listen": {
	"rpc_json": ":2012",
	"rpc_gob": ":2013",
	"http": ":2080",
},


"db": {
	"db_conns": {
		"*default": {
			"db_type": "mongo",
			"db_host": "127.0.0.1",	
			"db_port": 27017,
			"db_name": "10",
			"db_user": "cgrates"
		},
		"StorDB": {
			"db_type": "mongo",
			"db_host": "127.0.0.1",	
			"db_port": 27017,
			"db_name": "cgrates",
			"db_user": "cgrates"
		}
	},
	"items": {
		"*cdrs": {"limit": -1, "ttl": "", "static_ttl": false, "remote":false, "replicate":false, "dbConn": "StorDB"}
	}
},

"rates": {
	"enabled": true,
},


"cdrs": {
	"enabled": true,
},


"chargers": {
	"enabled": true,
	"attributes_conns": ["*internal"],
},


"resources": {
	"enabled": true,
	"store_interval": "1s",
	"thresholds_conns": ["*internal"]
},


"stats": {
	"enabled": true,
	"store_interval": "1s",
	"thresholds_conns": ["*internal"],
},


"thresholds": {
	"enabled": true,
	"store_interval": "1s",
},


"routes": {
	"enabled": true,
	"stats_conns": ["*localhost"],
	"resources_conns": ["*localhost"],
},


"attributes": {							// Attribute service
	"enabled": true,				// starts Attribute service: <true|false>.
},


"loaders": [
	{
		"id": "CustomLoader",								
		"enabled": true,								
		"tenant": "cgrates.org",
		"run_delay": "0",									
		"lockfile_path": ".cgr.lock",					
		"caches_conns": ["*internal"],
		"field_separator": ",",
		"tp_in_dir": "/tmp/In",
		"tp_out_dir": "/tmp/Out",
		"data":[	
			{
				"type": "*attributes",						
				"file_name": "Attributes.csv",				
				"fields": [
					{"tag": "AttributesFields","type": "*template", "value": "attrTemplateLoader"}
				],
			},
		],
	},
	{
		"id": "WithoutMoveToOut",			
		"enabled": true,
		"tenant": "cgrates.org",
		"run_delay": "0",
		"lockfile_path": ".cgr.lock",
		"caches_conns": ["*internal"],
		"field_separator": ",",
		"tp_in_dir": "/tmp/LoaderIn",
		"tp_out_dir": "",
		"data":[
			{
				"type": "*attributes",
				"file_name": "Attributes.csv",
				"fields": [
					{"tag": "AttributesFields","type": "*template", "value": "attrTemplateLoader"}

				],
			},
		],
	},
	{
		"id": "SubpathLoaderWithoutMove",
		"enabled": true,
		"tenant": "cgrates.org",
		"run_delay": "0",
		"lockfile_path": ".cgr.lock",
		"caches_conns": ["*internal"],
		"field_separator": ",",
		"tp_in_dir": "/tmp/SubpathWithoutMove",
		"tp_out_dir": "",
		"data":[
			{
				"type": "*attributes",
				"file_name": "folder1/Attributes.csv",
				"fields": [
					{"tag": "AttributesFields","type": "*template", "value": "attrTemplateLoader"}

				],
			},
		],
	},
	{
		"id": "SubpathLoaderWithMove",
		"enabled": true,
		"tenant": "cgrates.org",
		"run_delay": "0",
		"lockfile_path": ".cgr.lock",
		"caches_conns": ["*internal"],
		"field_separator": ",",
		"tp_in_dir": "/tmp/SubpathLoaderWithMove",
		"tp_out_dir": "/tmp/SubpathOut",
		"data":[
			{
				"type": "*attributes",
				"file_name": "folder1/Attributes.csv",
				"fields": [
					{"tag": "AttributesFields","type": "*template", "value": "attrTemplateLoader"}

				],
			},
		],
	},
	{
		"id": "LoaderWithTemplate",
		"enabled": true,
		"tenant": "cgrates.org",
		"run_delay": "0",
		"lockfile_path": ".cgr.lock",
		"caches_conns": ["*internal"],
		"field_separator": ",",
		"tp_in_dir": "/tmp/templateLoaderIn",
		"tp_out_dir": "/tmp/templateLoaderOut",
		"data":[
			{
				"type": "*attributes",
				"file_name": "Attributes.csv",
				"fields": [
					{"tag": "AttributesFields","type": "*template", "value": "attrTemplateLoader"}
				],
			},
		],
	},
	{
		"id": "CustomSep",								
		"enabled": true,									
		"tenant": "cgrates.org",
		"run_delay": "-1",										
		"lockfile_path": ".cgr.lock",						
		"caches_conns": ["*internal"],
		"field_separator": "\t",							
		"tp_in_dir": "/tmp/customSepLoaderIn",				
		"tp_out_dir": "/tmp/customSepLoaderOut",									
		"data":[	
			{
				"type": "*attributes",				
				"file_name": "Attributes",			
				"fields": [
					{"path": "Tenant", "type": "*variable", "value": "cgrates.org", "mandatory": true},
					{"path": "ID", "type": "*variable", "value": "ATTR_;~*req.0", "mandatory": true},
					{"path": "FilterIDs", "type": "*variable", "value": "`*string:~*req.Destination:`;~*req.0"},
					{"path": "Attributes.Path", "type": "*variable", "value": "*req.Destination"},
					{"path": "Attributes.Type", "type": "*variable", "value": "*constant"},
					{"path": "Attributes.Value", "type": "*variable", "value": "~*req.1"},
				],
			},
		],
	}
],


"sessions": {
	"enabled": true,
	"rates_conns": ["*internal"],
	"cdrs_conns": ["*internal"],
	"chargers_conns": ["*internal"],
},


"migrator": {
	"out_datadb_type": "mongo",
	"out_datadb_port": "27017",
	"out_datadb_name": "10",
	"users_filters":["Account"],
},


"templates": {
	"attrTemplateLoader": [
		{"path": "Tenant", "type": "*variable", "value": "~*req.0", "mandatory": true},
		{"path": "ID", "type": "*variable", "value": "~*req.1", "mandatory": true},
		{"path": "FilterIDs", "type": "*variable", "value": "~*req.2"},
		{"path": "Weights", "type": "*variable", "value": "~*req.3"},
		{"path": "Blockers", "type": "*variable", "value": "~*req.4"},
		{"path": "Attributes.FilterIDs", "type": "*variable", "value": "~*req.5","new_branch":true},
		{"path": "Attributes.Blockers", "type": "*variable", "value": "~*req.6"},
		{"path": "Attributes.Path", "type": "*variable", "value": "~*req.7"},
		{"path": "Attributes.Type", "type": "*variable", "value": "~*req.8"},
		{"path": "Attributes.Value", "type": "*variable", "value": "~*req.9"},
	],
},


"admins": {
	"enabled": true,
},
}
