EventReaderService problem

68 views
Skip to first unread message

marek cervenka

unread,
Jun 10, 2021, 3:51:43 PM6/10/21
to CGRateS

i‘m trying  load data through ERS

i have problem find format of CSV file so i get one from test file

https://github.com/cgrates/cgrates/blob/master/ers/filecsv_it_test.go

fileContent1

 

i have this problem

Jun 09 14:43:37 2616ea8a0f80 cgr-engine[1371]: CGRateS <b5279a0> [1371]: <ERs> reading event: <{"Tenant":"cgrates.org","ID":"4c21427","Time":"2021-06-09T14:43:37.933413942Z","Event":{"Account":"1001","AnswerTime":"2013-11-07 09:42:26 +0000 UTC","Category":"call","Destination":"+4286517174964","OriginID":"dsafdsag","RequestType":"*postpaid","SetupTime":"2013-11-07 09:42:25 +0000 UTC","Subject":"1001","Tenant":"cgrates.org","ToR":"*voice","Usage":"20s"},"APIOpts":{}}> from reader: <*default> got error: <unsupported reqType: <>>

Jun 09 14:43:37 2616ea8a0f80 cgr-engine[1371]: CGRateS <b5279a0> [1371]: ERs finished processing file </var/spool/cgrates/ers/in/test.csv>. Total records processed: 2, events posted: 2, run duration: 337.732µs

 

tried

RequestType *prepaid, *rated


environment

  • docker centos7 systemd
  • [root@2616ea8a0f80 ~]# rpm -q cgrates
  • cgrates-0.11.0~dev-20210609095956+7bc479096.x86_64
  • mongodb as stordb and datadb 
  • config file https://pastebin.com/3CTWCpwA


any ideas where is problem?


second try was with

type: file_json

{

        "ToR": "*voice",

        "Tenant": "cgrates.org",

        "Subject":"subj1001",

        "Category": "*call",

        "Account": "1001",

        "AnswerTime": "2018-08-24T16:00:26Z",

        "SetupTime": "2018-08-24T16:00:26Z",

        "Destination": "+4986517174963",

        "OriginID": "testJsonCDR",

        "RequestType": "*pseudoprepaid",

        "Source": "jsonFile",

        "Usage": 120000000000

}

Jun 09 21:11:40 2616ea8a0f80 cgr-engine[1837]: CGRateS <46c418f> [1837]: <ERs> reading file: </var/spool/cgrates/ers/in/test2.json>  ignoring due to error: <NOT_FOUND:ToR>

but im not sure if file_json is stable function. its not in documentation

Marek


Alexandru Tripon

unread,
Jun 14, 2021, 9:52:54 AM6/14/21
to cgr...@googlegroups.com
Hi Marek,

Regarding the first error, the reqType doesn't refer to the RequestType of the record but at the empty flags from your config.
The flags are necessary to tell the CGRateS what to do with the read record.
Regarding the missing ToR you must have a different template than the one used for *file_csv reader as the *file_json reads another data format.

Thanks,
Trial97


--
You received this message because you are subscribed to the Google Groups "CGRateS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cgrates+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cgrates/8eeb994d-1522-468f-a345-589f1abe5959n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages