{

"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", 
            "sqlBatchSize": -1,
            "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.extra_info"},
            {"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",		
            "ees_success_ids": ["SQLExporter"],				
            "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",
            ],										
            "flags": ["*dryrun"],										
            "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},
            ],
        },
    ],
},

}