NiFi Expression Language in UpdateAttribute

2020-06-11 Thread Russell Bateman
I wnat to create an attribute, format-type, which I hoped would be set based on the in-coming flowfile name:     ${ ${filename:endsWith( 'xml' )} : ifElse( 'XML', 'JSON' ) } If the in-coming flowfile name is /sample.xml/, the result is nevertheless and always format-type = JSON I want it to

Re: NiFi Expression Language in UpdateAttribute

2020-06-11 Thread Bryan Bende
Hello, The EL docs have some good examples: https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#ifelse -Bryan On Thu, Jun 11, 2020 at 10:14 AM Russell Bateman wrote: > I wnat to create an attribute, format-type, which I hoped would be set > based on the in-coming flowf

Re: NiFi Expression Language in UpdateAttribute

2020-06-11 Thread Shawn Weeks
Your syntax is incorrect. Try this instead. ${filename:endsWith('xml'):ifElse('XML','JSON')} From: Russell Bateman Reply-To: "users@nifi.apache.org" Date: Thursday, June 11, 2020 at 9:15 AM To: NiFi Users Subject: NiFi Expression Language in Update

Re: NiFi Expression Language in UpdateAttribute

2020-06-11 Thread Russell Bateman
ussell Bateman *Reply-To: *"users@nifi.apache.org" *Date: *Thursday, June 11, 2020 at 9:15 AM *To: *NiFi Users *Subject: *NiFi Expression Language in UpdateAttribute I wnat to create an attribute, format-type, which I hoped would be set based on the in-coming flowfile name:     ${ $

Re: NiFi Expression Language in UpdateAttribute

2020-06-11 Thread Andy LoPresto
t;mailto:users@nifi.apache.org> >> Date: Thursday, June 11, 2020 at 9:15 AM >> To: NiFi Users <mailto:users@nifi.apache.org> >> Subject: NiFi Expression Language in UpdateAttribute >> >> I wnat to create an attribute, format-type, which I hoped w

Unexpected JSON Path behaviour with NiFi Expression Language in UpdateAttribute (and confusing ReplaceText output)

2020-03-06 Thread Chris Sampson
Hi, (Copied form Slack channel) I’m seeing some confusing behaviours with the Expression Language json path functions and ReplaceText for adding JSON into a file (1.11.3): given input of (read into a FlowFile attribute named record_json via the EvaluateJsonPath processor): { "person": { "

Re: Unexpected JSON Path behaviour with NiFi Expression Language in UpdateAttribute (and confusing ReplaceText output)

2020-03-06 Thread Chris Sampson
A little further investigation/tinkering: I suspect the ReplaceText issue is that the JSON is being parsed and the duplicate metadata field is causing a problem, then one of them is being thrown away adding a teplaceFirst function call the remove the ,"metadata":{} from the attribute first has