Member since
08-18-2019
56
Posts
11
Kudos Received
18
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
640 | 11-15-2023 05:38 AM | |
2325 | 07-12-2023 05:38 AM | |
695 | 01-10-2023 01:50 AM | |
982 | 12-06-2022 12:08 AM | |
3812 | 12-02-2022 12:55 AM |
11-15-2023
05:38 AM
Try that value: ${kafka.topic:contains('alerts'):ifElse('customerTopicKafkaTesting1',${kafka.topic:contains('events'):ifElse('customerTopicKafkaTesting2',${kafka.topic:contains('ack'):ifElse('customerTopicKafkaTesting3','Not_Found')})})} You forgot to close ${kafka.topic:contains('events')...}
... View more
07-12-2023
06:30 AM
@MWM Your description is not super clear to me. FlowFile Attributes are in format of <attribute name>=<attribute value> example key=value FlowFile attributes: Attribute name = Attribute value
name=toyota
type=car Here is how I interpret what you have provided: - You have a FlowFile that has a custom FlowFile "Attribute Name" on it "name". - That "name" Attribute has no value associated to it. (name = ) The UpdateAttribute processor allows you to add new key=value (attribute name = attribute value) attribute pairs to an existing FlowFile or modify the value of an existing FlowFile Attribute Name. You can NOT create a new attribute and then modify or use that new attribute within the same processor in which it was created. Lets say you have a FlowFile with the example FlowFile attributes and values I shared above. Then you use the UpdateAttribute processor to change the value on the Attribute "name" to all uppercase. The NiFi Expression Language (NEL) statement you created: ${name:toUpper()} will take the subject "name" and return it's value "toyota". That returned value is passed to the toUpper() NEL function which converts the it to Uppercase "TOYOTA". The resulting value is then written to the FlowFile attribute defined in the UpdateAttribute processor. Assuming an UpdateAttribute processor configured as below: The NEL expression resulting a new value of "TOYOTA" would be written to the FlowFile Attribute "name" since "name" already exists as an attribute on the FlowFile, its current attribute value of "toyota" would be replaced with new value "TOYOTA". Hope this helps clarify how NiFi FlowFile Attributes and the UpdateAttribute processor is used. If you found that the provided solution(s) assisted you with your query, please take a moment to login and click Accept as Solution below each response that helped. Thank you, Matt
... View more
07-12-2023
05:50 AM
Hello community, I have currently every ~5 days the problem that FlowFiles from the Wait Processor are not get released, only after the "Expiration Duration" was reached (and then routed to the expired relationship). The DistributedMapCacheClientService/DistributedMapCacheServer is used and the problem was prevalent in 1.17/1.20/1.21. After restarting Nifi everything is working fine again with new arrived flowfiles, except that the old flowfiles are still hanging in the wait relationship. Has anyone also experienced the same problem or know what the problem could be? Thank you!
... View more
Labels:
- Labels:
-
Apache NiFi
06-25-2023
12:21 PM
Apache PDFBox is supposed to allow you to merge PDF content. Since this is a Java library you can create a scripted Groovy processor to merge the files for you. https://pdfbox.apache.org https://javadoc.io/doc/org.apache.pdfbox/pdfbox/2.0.27/index.html
... View more
04-26-2023
09:54 PM
"createdOn": {"$date":"${now():format('YYYY-MM-dd HH:mm:ss'):replace(' ', 'T'):append('.000+00:00')}"} used this to store ISO date format in mongo db from Jolt and nifi expression language.
... View more
01-13-2023
07:39 AM
Hi I want to extract a CSV file from SQL query one of the columns should be present in the CSV twice, diffirent position. I had the same error is there a workaround ? Thank you
... View more
01-10-2023
01:50 AM
Hello @Techie123, can you tell a bit more about what you want to achive? Do you want just use the first or second object of 'data'? Then you have to change: "data": {
"0": { "data": {
"1": { Or how do you want to progress - can it that the numbers are not similiar? We dont know how your results can be look like Greetings
... View more
01-03-2023
01:57 PM
1 Kudo
I found a solution, this is the script: @Grapes(@Grab(group='org.apache.poi', module='poi-ooxml', version='3.9'))
import com.opencsv.CSVReader
@Grapes(@Grab(group='com.opencsv', module='opencsv', version='4.2'))
import org.apache.poi.ss.usermodel.*
import org.apache.poi.xssf.streaming.*
import org.apache.poi.hssf.usermodel.*
import org.apache.poi.xssf.usermodel.*
import org.apache.poi.ss.util.*
import org.apache.poi.ss.usermodel.*
import org.apache.poi.hssf.extractor.*
import java.nio.charset.*
import java.io.*
import org.apache.commons.io.IOUtils
def flowFile = session.get()
def date = new Date()
if(!flowFile) return
flowFile = session.write(flowFile, {inputStream, outputStream ->
SXSSFSheet sheet1 = null;
CSVReader reader = null;
Workbook wb = null;
String generatedXlsFilePath = "/home/";
FileOutputStream fileOutputStream = null;
def filename = flowFile.getAttribute('filename')
def path = flowFile.getAttribute('path')
def nextLine = ''
reader = new CSVReader(new FileReader(path+filename), ',');
//Workbook wb = WorkbookFactory.create(inputStream,);
//Sheet sheet1 = wb.createSheet("Feuille");
wb = new SXSSFWorkbook(inputStream);
sheet1 = (SXSSFSheet) wb.createSheet('Sheet');
def rowNum = 0;
while((nextLine = reader.readNext()) != null) {
Row currentRow = sheet1.createRow(rowNum++);
for(int i=0; i < nextLine.length; i++) {
if(NumberUtils.isDigits(nextLine[i])) {
currentRow.createCell(i).setCellValue(Integer.parseInt(nextLine[i]));
} else if (NumberUtils.isNumber(nextLine[i])) {
currentRow.createCell(i).setCellValue(Double.parseDouble(nextLine[i]));
} else {
currentRow.createCell(i).setCellValue(nextLine[i]);
}
}
}
//fileOutputStream = new FileOutputStream(generatedXlsFilePath.trim());
//wb.write(fileOutputStream);
generatedXlsFilePath = generatedXlsFilePath + 'SAISIE_MAGASING.XLS'
outputStream = new FileOutputStream(generatedXlsFilePath.trim());
wb.write(outputStream);
wb.close();
//fileOutputStream.close();
outputStream.close();
reader.close();
//outputStream.close();
inputStream.close();
} as StreamCallback)
flowFile = session.putAttribute(flowFile, 'filename', filename)
... View more
01-02-2023
10:41 AM
What I am tryin mg to do is install a nifi cluster onto 3 Ubuntu 22.04 clients. I first installed nifi on each client independently. And then attempted to install a cluster using the same clients…I first stopped the nifi service running on each of the clients before attempting to install a cluster. Should I not install nifi separately on each of the clients before attempting to install the cluster? thank you for any guidance
... View more
12-10-2022
06:46 AM
Hi @Faerballert , Thank you so much. I tried it earlier the same but not sure why it were not working. some of my fields contains null values. But instead of null I want the empty string in the same jolt. Can we do that? is there any option to do the same.
... View more