2017-03-25 71 views
1

我想創建這樣春天XD - 在規劃環境地政司表達的邏輯運算符和過濾

file --outputType=text/plain --dir=someDir --mode=lines | filter --expression='payload.contains(\"request url\") AND payload.contains(\"request method\")' | log 

過濾器,我就在控制檯上可視化包含request URLrequest method線。

我根據this question

使這個流可惜的是,我這個錯誤:

.... Caused by: org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'expressionString' threw exception; nested exception is org.springframework.expression.spel.SpelParseException: EL1065E:(pos 17): unexpected escape character.

編輯:我已經通過弗洛

回答

0

部署的流哪個版本是你使用?我只是試圖與1.3.1,沒有任何問題......

xd:>stream create foo --definition "tcp --outputType=text/plain | filter --expression='payload.contains(\"foo\") AND payload.contains(\"bar\")' | log" --deploy 

$ telnet localhost 1234 
Trying ::1... 
Connected to localhost. 
Escape character is '^]'. 
abc 
foobar 

結果:

2017-03-25T08:59:57-0400 1.3.1.RELEASE INFO xdbus.foo.1-1 sink.foo - foobar 

編輯

當使用FLO(管理界面),使用''代替\" ...

foo = tcp --outputType=text/plain | filter --expression='payload.contains(''foo'') AND payload.contains(''bar'')' | log 
+0

我正在使用1.3.1。在你的消息之後,我通過shell部署了同樣的問題流(首先我通過Flo部署)。使用shell就可以了,通過Flo,相同的流不能正常工作,並返回問題的錯誤。 – strano

+0

使用''''而不是'''與flo - 看到我的答案更新(我剛剛測試過)。 –

+0

現在一切都好!非常感謝! – strano

相關問題