This seem such a stupid problem, but we're trying to define dataflows stream from the SCDF shell application, but we're running into issues with quoting. Let's say we want to define a filter with a SpEL expression to just filter out anything where JSON input doesn't have the name John Doe. The SpEL would be:
payload.name != 'John Doe'
or
payload.name ne 'John Doe'
The stream definition would be:
stream create --name testflow --definition "http | filter --expression=<expression> | log"
I can't surround the <expression> with single quotes because the expression itself contains single quotes, and I can't use double quotes because the whole stream definition uses those. I can't just leave quotes of because then the shell's parser gets confused by both the spaces and the !. Is defining this stream simply impossible from the shell app? It is possible to do from the browser app, but other dataflow defs have parsing problems there.
Defining filter expressions with string literals is a little tricky. We should enclose the string literal (with spaces) within two single quotes instead of a double quote.
stream create --name test --definition "http | filter --expression='!(payload.firstName==''Joe Robert'' and (payload.lastname==''Smith'' or payload.prod==''Williams''))' |log"
Only the definition is enclosed in double quotes above. Reference : https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#spring-cloud-dataflow-stream-intro-dsl