2016-08-27 1 views
0

J'utilise une table en mémoire dans le plan d'exécution mais le compilateur pose des questions sur sa définition. La requête estWSO2CEP: La définition de flux/table avec ID n'a pas été définie dans le plan d'exécution

@Import('MAINInStream:1.0.0') 
define stream MAINInStream (ts string, uid string, id_orig_h string, id_orig_p int, id_resp_h string, id_resp_p int, proto string, service string, duration double, orig_bytes long, resp_bytes long, conn_state string, local_orig bool, local_resp bool, missed_bytes long, history string, orig_pkts long, orig_ip_bytes long, resp_pkts long, resp_ip_bytes long, tunnel_parents string, sensorname string); 

@Export('ProtocolStream:1.0.0') 
define stream ProtocolStream (protocol string, count int); 

@from(eventtable = 'rdbms' , datasource.name = 'WSO2_CARBON_DB' , table.name ='conn_log_table') 
define table conn_log_table (ts string, uid string, id_orig_h string, id_orig_p int, id_resp_h string, id_resp_p int, proto string, service string, duration double, orig_bytes long, resp_bytes long, conn_state string, local_orig bool, local_resp bool, missed_bytes long, history string, orig_pkts long, orig_ip_bytes long, resp_pkts long, resp_ip_bytes long, tunnel_parents string, sensorname string); 

define table mem_conn_table (timestamp string, id_orig_h string, id_orig_p int, id_resp_h string, id_resp_p int, proto string); 

from MAINInStream 
select * 
insert into conn_log_table; 

from MAINInStream 
select time:dateAdd(str:replaceAll(ts,'T',' '), 5, 'hour',"yyyy-MM-dd HH:mm:ss") as timestamp, id_orig_h, id_orig_p, id_resp_h, id_resp_p, proto 
insert into mem_conn_table; 

from mem_conn_table[time:dateDiff(time:currentTimestamp(), timestamp, "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm:ss") == 0] 
SELECT (ifThenElse(id_resp_p == 21,'FTP', ifThenElse(id_resp_p == 22,'SSH', ifThenElse(id_resp_p == 25,'SMTP', ifThenElse(id_resp_p == 445,'SMB','MYSQL'))))) as protocol , count() as count 
insert into ProtocolStream; 

mem_conn_table est ce qui cause le problème qui commence quand j'ajoute la dernière requête. J'utilisais la table des événements d'une manière incorrecte.

Répondre

0

Pour l'utiliser il faut le joindre avec un flux d'entrée et une fenêtre de longueur appropriée.