Member since
11-26-2016
9
Posts
2
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
1954 | 11-26-2016 09:34 PM |
02-02-2021
08:26 AM
@peter_coppens While the HTTP spec may be case insensitive, NiFi Expression Language (EL) is case sensitive. Are we talking about an undefined number of unique header case sensitivity here? I would think you have a short defined list of possible header values here, correct? There are multiple EL functions you can use here: 1: ${http.headers.x-My-Header:isNull():ifElse('${http.headers.x-my-header}','${http.headers.x-My-Header}'):......} In above if subject "http.headers.x-My-Header" does not exist on the FlowFile it returns the value from "http.headers.x-my-header" attribute instead; otherwise it returns value from "http.headers.x-My-Header". Then you can continue the EL statement to do whatever additional manipulation needed. 2: ${allMatchingAttributes('(?i)http\.headers\.x-my-header'):join(''):....} In above it uses a case insensitive Java regular expression within the "AllMatchingAttribtes( )" EL function to return values from all FlowFile attributes that satisfy that regex and then use the "join( )" function to merge them all together. Since we expect that only one attribute will actually match, the result is just a single value. This may be best option. 3: ${http.headers.x-My-Header:replaceNull(${http.header.X-my-header:replaceNull(${http.headers.x-my-header})}):....} In above we chain multiple "replaceNull( )" functions to iterate through all case permutations till we find one that exist as an attribute on the FlowFile. Note: In any of the above you would replace that last ":...." with the rest of your EL statement fucntions needed to manipulate the subject returned as you need. Options 1 and 3 require you to know all case permutations that may exist. Option 2 may be best choice as you do not need to know all the permutations, but can be an issue if for some reason you have multiple permutations of the same attribute on the same FlowFile. Hope this helps, Matt
... View more
02-21-2020
11:23 AM
I ended up building from source based on 1.11.1 tag and then it works fine
... View more
12-24-2019
03:43 AM
1 Kudo
Hello, Tx for your reaction Dennis. I was able to continue. The reason I was having issues seemed to be related to the fact that the Groovy script was a standard class with a static main method. It makes sense that Nifi does not accept that I guess, but the process of diagnosing such issue might be made easier imo. It was a trial and error task, and as you suggested, by starting from an example. Anyway, I am good now 🙂 Regards Peter
... View more
11-26-2016
09:34 PM
It seems that by removing the call to master('yarn') when building the SparkSession, the issue is gone.
... View more