coralogixProcessor: Unexpected error - SyntaxError: Unexpected token in object literal - alertId: -

shrehalb
Mega Explorer

I have added Service Now webhooks to Coralogix alerts. Whenever Coralogix triggers an alert based on certain condition, I expect Coralogix to pass on the alert data to service now using that web hook. 

The connection between Coralogix and Service now is working fine without any issue. There seems to be a problem within service now to parse the data sent by Coralogix to it.  
Please help me debug this. I searched web but couldn't reach solution.

 

I am attaching the full error message as follows

 

coralogixProcessor: Unexpected error - SyntaxError: Unexpected token in object literal - alertId: - payload: {"uuid":"1dedc04c-5f52-7679-94c6-9f4df5adb4dc","alert_id":"502c89e6-0735-4dee-a804-98d9574a34d8","name":"Test Gflag Ratio Alerts 3 tenant details TGBV On","description":"Same as Ratio Alert 4, but Notifications should only container triggered group by value is ticked","threshold":"100000","timewindow":"1440","group_by_labels":"[\"source_cluster_uuid_enriched.tenantName\"]","alert_action":"trigger","alert_url":"https://draas-on-nutanix.app.coralogix.us/#/insights?id=58adfb0f-6c96-435c-afc0-4eb3211f7b24","log_url":"https://draas-on-nutanix.app.coralogix.us/#/query-new/logs?id=9hr6eV7BfVshKbsMmrGQEi","icon_url":"https://dashboard.coralogix.com/assets/invite.png","fields":[{"key":"team","value":"draas-on-nutanix"},{"key":"application","value":""},{"key":"subsystem","value":""},{"key":"severity","value":"INFO"},{"key":"computer","value":"Multiple Servers"},{"key":"ipAddress","value":"Multiple IPs"},{"key":"timestamp","value":"2023/04/19 12:41:54 GMT"},{"key":"hitCount","value":"{\"source_cluster_uuid_enriched.tenantName\":{\"perlickcorporation\":72,\"mdusd\":66,\"ames\":96,\"countyofcrook\":78,\"hallmarktubulars\":66,\"hockeycanada\":66,\"cityofberkeley2\":78,\"laingorourkeaustralia\":66,\"lapfcu\":72,\"kskus\":84,\"abc\":72,\"cityofalbanyca\":72,\"havashelia\":126,\"slsd\":72,\"gwelectric\":72,\"nutanix-support1\":78,\"ddsd40\":72,\"beediegroup\":24,\"altaone\":80,\"xilabtenant63\":66,\"sjgh\":90,\"mnu\":72,\"comptonunified\":78,\"xilabtenant17\":66,\"xilabtenant14\":64,\"nutanixservices\":66,\"peoplesbankofcommerce\":72,\"deangelobrothersinc\":90,\"durhamjonespinegar\":72,\"nf-ntnx-xl\":72,\"oneworkplace\":66,\"formulatedsolutionsllc\":84,\"bssd\":84,\"internal-engg-xigro\":78,\"fffenterprises\":78,\"quantumradiology\":110,\"cwresources\":66,\"bonnechance\":28,\"mosaicforests\":82,\"cityofberkeley\":86,\"eulerhermesuswest\":84,\"xiint-new-benedeximus\":78,\"internal-engg-benedeximus\":72,\"afncorp\":82,\"olyclub\":84,\"parkersmithfeekinc\":84,\"wtotrial\":144,\"xiinttestrno1\":27,\"norrisppd\":72,\"assurxinc\":86,\"engieusa\":90,\"milgard-mfg\":90,\"hccc\":72,\"pugetsoundfire\":81,\"nadb\":72,\"catpumpscorporation\":72,\"elementfleetmgt\":200,\"xilabtenant16\":66,\"xilabtenant-60\":66,\"xilabtenant62\":66,\"ftpartners\":66,\"hbr-ul\":140,\"pumabiotechnology\":72,\"xilabtenant61\":66,\"khs-net\":120,\"xilabtenant50\":66,\"rkmechanicalinc\":84,\"vhlv\":78,\"selcocreditunion\":127,\"xilabtenant64\":66,\"texasmedicalcenter\":72,\"siteimpact\":66,\"chas\":96,\"heritagebankofcommerce\":82,\"csicompanies\":72,\"corbanuniversity\":78,\"srg\":96,\"greenhassonandjanks\":72,\"centaurihs\":72}}"},{"key":"text","value":""},{"key":"ratioQueryTwo","value":"Query 2"},{"key":"ratioTimeframe","value":"(18/04/2023 12:30 - 19/04/2023 12:30)"},{"key":"ratioGroupByKeys","value":"[\"source_cluster_uuid_enriched.tenantName\"]"},{"key":"metaLabels","value":"null"}]}

 

1 REPLY 1

Ratnakar7
Mega Sage
Mega Sage

Hi @shrehalb ,

 

The error message you received indicates that Service Now is having trouble parsing the data that was sent by Coralogix. The error message specifically mentions a "SyntaxError: Unexpected token in object literal." This means that there is likely a problem with the JSON formatting of the payload that was sent to Service Now.

To further investigate the issue, you can try to validate the payload using a JSON validator such as JSONLint. This will help identify any syntax errors or formatting issues with the payload.

Additionally, you can try to isolate the issue by sending a test payload to Service Now using a tool such as Postman. This will help you verify if the issue is with the payload being sent by Coralogix or if it's with Service Now's ability to parse the payload.

Once you've identified the issue, you can update the payload accordingly to ensure that it's correctly formatted and can be parsed by Service Now.

 

If my response was helpful in resolving the issue, please consider accepting it as a solution by clicking on the Accept solution button and giving it a thumbs up 👍. This will benefit others who may have a similar question in the future.

 

Thank you!

Ratnakar