tomdz / storm-esper

Storm - Esper integration experiment
http://tomdz.github.com/storm-esper/
197 stars 68 forks source link

Error validating "Followed-by" query #9

Open ValeFormi opened 10 years ago

ValeFormi commented 10 years ago

Dear Tomdz, it would be great if you could assist me to fix the following error while using your code. I've implemented a "followed-by" statement on a topology in the two variants below and received the errors shown at the end:

1) select a.interface as Interface from pattern [every a=ManagementSystems -> b=ManagementSystems (a.interface='192.168.1.1' and b.interface='192.168.1.2')] 2) select ManagementSystemsEvent.interface as Interface from pattern [every a=ManagementSystems -> b=ManagementSystems (ManagementSystemsEvent.interface='192.168.1.1' and ManagementSystemsEvent.interface='192.168.1.2')]

This query should simply verify if the "interface" field follows that pattern on the ManagementSystems stream. No temporal window is specified here. Here, ManagementSystems is the stream name defined through the "toEventType" call of the InputBuilder. ManagementSystemsEvent is the class type declared through the methods "withFields" and "ofType". Before showing the errors I tell that this configuration works if I use a query like this: select ManagementSystemsEvent.interface as Interface from ManagementSystems.win:time(1 min) where ManagementSystemsEvent.interface='192.168.1.1'.

Here the errors. Error for type 1 query): Failed to validate filter expression 'a.interface="192.168.1.1" and a.int...(55 chars)': Failed to resolve property 'a.interface' to a stream or nested property in a stream [ select a.interface as Interface from pattern [every a=ManagementSystems -> b=ManagementSystems (a.interface='192.168.1.1' and a.interface='192.168.1.2')] ]

Error for type 2 query):

[Thread-22-FinalQuery_GlobalQuery1] ERROR backtype.storm.util - Async loop died! com.espertech.esper.client.EPStatementException: Error starting statement: Failed to validate select-clause expression 'ManagementSystemsEvent.interface': Failed to resolve property 'ManagementSystemsEvent.interface' to a stream or nested property in a stream [ select ManagementSystemsEvent.interface as Interface from pattern [every a=ManagementSystems -> b=ManagementSystems (ManagementSystemsEvent.interface='192.168.1.1' and ManagementSystemsEvent.interface='192.168.1.2')] ] at com.espertech.esper.core.service.StatementLifecycleSvcImpl.startInternal(StatementLifecycleSvcImpl.java:650) ~[esper-5.0.0.jar:na]

Many thanks in advance. Bye Val.

ValeFormi commented 10 years ago

Solved. This is the correct statement in this case. select a.ManagementSystemsEvent.interface as Newfield from pattern [every a=ManagementSystems -> b=ManagementSystems (a.ManagementSystemsEvent.interface='192.168.1.1' and b.ManagementSystemsEvent.interface='192.168.1.2')]