I have written a custom http receiver, it get events from another system, and the json sample like :
{"tag":"A01","time":"10:01:00","value":"30.01"},
{"tag":"A01","time":"10:01:01","value":"35.01"},
{"tag":"A01","time":"10:01:02","value":"31.01"},
{"tag":"B01","time":"10:01:00","value":"105.017"},
{"tag":"B01","time":"10:01:01","value":"230.01"},
{"tag":"B01","time":"10:01:02","value":"117.01"}
than the receiver send the json one by one to stream name "tag_input_stream" which contains fields:
tag string, time string, value double
now I have another stream name format_tag_stream which contains field:
time string, tag_A_val double, tag_B_val double
I want to insert values into format_tag_stream from tag_input_stream like this:
10:01:00, 30.01 , 105.017
10:01:01, 35.01 , 230.01
10:01:02, 31.01 , 117.01
I used Execustion Plan to write siddhi script :
from every(e1=tag_input_stream)->e2=tag_input_stream[time==e1.time]
select e1.time as time, e1.value as v1, e2.value as v2
insert into format_tag_stream
But it doesn't work. How to write the script, any example? Thanks