0

From device, the information is sent to the c8y platform. The parameter values are in HEX and we convert it to Integer or string using a Event processing script. The converted values are stored in the database table.

But we are facing a challenge in displaying the values in the explorer graph in the cockpit application from the database table.

It will be very helpful if you could provide any sample code to display a graph using the event processing script.

@Name("createdTempSchema") create schema UplinkUpdateEvent (msg string,time 
                           Date,msgid string); 
@Name("UplinkUpdateEvent") insert into UplinkUpdateEvent select 
                           event.event.source.value as msgid, 
                           event.event.time as time, 
                           getString(event, "objectResourceValue") as msg 
                           from EventCreated event 
                           where event.event.type.startsWith("c8y_UpLin"); 
@Name("createUplinkAlarm") insert into CreateAlarm select "c8y_UpLinkMsgAlarm" as type,
                           u.time as time,u.msgid as source,
                           "CRITICAL" as severity,
                           "ACTIVE" as status,
                           msg as text from UplinkUpdateEvent u 
                           where u.msg is not null;
Henrique C.
  • 948
  • 1
  • 14
  • 36
  • Can you post Code Snippets to help you get an answear you seek. – Henrique C. Mar 27 '19 at 09:51
  • @Name("createdTempSchema") create schema UplinkUpdateEvent (msg string,time Date,msgid string); @Name("UplinkUpdateEvent") insert into UplinkUpdateEvent select event.event.source.value as msgid, event.event.time as time, getString(event, "objectResourceValue") as msg from EventCreated event where event.event.type.startsWith("c8y_UpLin"); @Name("createUplinkAlarm") insert into CreateAlarm select "c8y_UpLinkMsgAlarm" as type,u.time as time,u.msgid as source,"CRITICAL" as severity,"ACTIVE" as status, msg as text from UplinkUpdateEvent u where u.msg is not null; – Seshathiry Ranganathan Mar 28 '19 at 06:17

0 Answers0