Member since
11-16-2015
898
Posts
659
Kudos Received
248
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
522 | 06-26-2025 01:21 PM | |
380 | 06-19-2025 02:48 PM | |
608 | 05-30-2025 01:53 PM | |
9424 | 02-22-2024 12:38 PM | |
2013 | 02-02-2023 07:07 AM |
12-06-2021
08:50 AM
@mburgess .. Hope you are doing good. I am facing issue while creating a groovy script for Scripted Reader Controller service in Convert Record processor. I want read the Flat width file input but script validation is getting failed again and again. It is giving 'groovy.lang.MissingPropertyException: No such property: session for class: Script' My code is below (also not sure my logic is correct for reading the Fixed Width File as input) Please let me know what's the issue here. import org.apache.commons.io.IOUtils import java.nio.charset.StandardCharsets import java.nio.charset.UnsupportedCharsetException; import java.io.IOException; import org.apache.nifi.controller.ControllerService flowFile = session.get() if(!flowFile) return try { def text = '' // Cast a closure with an inputStream parameter to InputStreamCallback session.read(flowFile, {inputStream -> def readIN = IOUtils.toString(inputStream, StandardCharsets.UTF_8) names = [] text = readIN.eachLine { names << [ data: it[0..7].trim(), name: it[8..33].trim(), isr: it[34..43].trim() ]} readIN.close() } as InputStreamCallback) session.transfer(flowFile, REL_SUCESS) } catch(e) { log.error("Error while processing the flowfile") session.transfer(flowFile, REL_FAILURE) }
... View more
11-28-2021
08:51 PM
Hello Team, I am facing some problem while running JAR file from NIFI. please find below screenshot for same could anyone help for same?
... View more
09-29-2021
09:06 AM
@mburgess I used your 1st suggestion and it worked like a charm with just one exception. The header row was index 1. I'm not sure if was just me, my data, or some property/attribute I set wrong. Just thought you should know. So, after modifying the user-defined attribute value to ${fragment.index:gt(1)} it worked. And, in case you ask, the header row is the first row in the CSV file which doesn't make sense unless the processor logic changed to 1-based indexing instead of 0-based indexing. Also, thanks for all of your blog posts. I use your suggestions a lot.
... View more
08-30-2021
07:52 PM
Hi @Sbofa Yes you are right. Based on kind it will decide which kind of spark shell needs to start.
... View more
07-22-2021
03:08 PM
cool tool. I updated to work with 1.12.1: https://gist.github.com/tpanagos/fb8ca4afb16b00862429ffc87dc65348
... View more
05-28-2021
03:07 PM
Hi @jerry_pylarinos and @mburgess I am seeing weird behavior in the same scenario but the only difference is my spec has expression language inside Jspec and it never resolved after pulling from the cache and passing as an attribute to jolttransform. Is that a bug? like if you jspec.json has [
{
"operation": "modify-overwrite-beta",
"spec": {
"id": "${UUID()}"
}
}
] and your generate flow file has {
"id" : "anyname"
} You result looks like this {
"id":"${UUID()}"
} How to evaluate expression langauge here?
... View more
05-11-2021
05:09 AM
1 Kudo
Thanks @VidyaSargur - I just started a new thread, per your suggestion.
... View more
03-24-2021
03:23 PM
1 Kudo
What are the column names in your table? Assuming "carId" and "carType", you can use JoltTransformJson or JoltTransformRecord with the following spec: [ { "operation": "shift", "spec": { "*": { "$": "carId", "@": "carType" } } }, { "operation": "shift", "spec": { "carId": { "*": { "@": "[&0].carId" } }, "carType": { "*": { "@": "[&0].carType" } } } } ]
... View more
03-02-2021
08:55 AM
How to perform the same for the very first occurrence of [ and last occurrence of ].
... View more
02-14-2021
12:23 AM
Hi @mburgess Can you please elaborate on which property needs to be configured in the GrokReader controller service for using the kv filter? I'm trying to parse the incoming key=value pair. Input: key1=value1,key2=value2,key3=value3,key4=value4 output: I need key1, key2, key3, key4 as attributes and their respective values as attribute values I can use %{GREEDYDATA:msgbody} in the GrokExpression property but I do not know where to provide kv { source = "msgbody" } Your help is appreciated
... View more