apache-nifi

'DBCPConnectionPool' Service Not accepting values stored in attributes

十年热恋 提交于 2019-12-11 04:56:58
问题 Following are the combination of processors that I am using:- GetFile + SplitText + ExtractText + UpdateAttribute + ExecuteSQL + ConvertAvroToJson + PutFile Basically,I have a properties file which contains 5 comma separated values that are required by the 'DBCPConnectionPool' controller service to establish connection with the database. Here is the content of my properties file:- jdbc:mysql://localhost:3306/test,com.mysql.jdbc.Driver,C:\Program Files\MySQL\mysql-connector.jar,root,root Now,

How to convert XML to JSON with new JSON structure in Nifi?

流过昼夜 提交于 2019-12-11 04:24:56
问题 I get different XML s from web services. I want to convert this XML to JSON , but structure must be changed. For example, I have XML structure like this; <root> <A attr="attr1">VAL</A> <B attr="attr2">VAL</B> </root> And result of JSON that I want. { "root":{ "Items":[ { "tag_name":"A", "attr":"attr1", "value":"VAL" }, { "tag_name":"B", "attr":"attr2", "value":"VAL" } ] } } How can I do this in Nifi ? ConvertRecord or UpdateRecord ? Also, how should read and write schema for this if record

Access Json element and write to a text file using python ExecuteScript processor

我只是一个虾纸丫 提交于 2019-12-11 04:22:08
问题 I am new to python and nifi. My flow is GetFile-->ExecuteScript In the script, for each json,i want to accesss a particular element and write it to a text file line by line. I tried the below: import json import java.io from org.apache.commons.io import IOUtils from java.nio.charset import StandardCharsets from org.apache.nifi.processor.io import StreamCallback class ModJSON(StreamCallback): def __init__(self): pass def process(self, inputStream, outputStream): text = IOUtils.toString

Wait-Notify for parallel & sequential processing in Nifi

人走茶凉 提交于 2019-12-11 02:39:01
问题 I have a requirement where I need to execute 4 jobs parallel and when same items job is done in all 4 processors parallely then trigger the next processor for this I have used wait-notify Flow is like 4 parallel jobs -> notify (release signal identifier = ${itemid}, signal counter name = ${processorname}) -> wait (release signal identifier = ${itemid}, target signal count = 4) and wait relationship is connected to the same wait processor-> next processor This works for first time but I have

How to use ExecuteScript (with python as a script engine) for an exercise to add numbers? [Novice user trying to learn NiFi]

筅森魡賤 提交于 2019-12-11 02:26:16
问题 I am relatively new to NiFi and am not sure how to do the following correctly. I would like to use ExecuteScript processor (script engine: python) to do the following (only in python please): 1) There is a CSV file containing the following information (the first row is the header): first,second,third 1,4,9 7,5,2 3,8,7 2) I would like to find the sum of individual rows and generate a final file with a modified header. The final file should look like this: first,second,third,total 1,4,9,14 7,5

Trying To Solve remove the timestamp format conversion error by using “UpdateAttribute” processor i.e. ConvertJSONtoSQL-> UpdateAttribute--> PutSQL

99封情书 提交于 2019-12-11 01:44:34
问题 From This Answer Same issue but no luck in my case i'm using ConvertJsonToSql---->(Relationship--SQL,Original)---->Update Attribute(Poperty from your answer)------>PutSql. java.sql.SQLDataException :The value of the sql.args.28.value is Mon Oct 09 23:55:23 which cannot be converted to a timestamp. In Database date is storing in mysql datetime format 2017-09-11 14:26:13. NiFi flow file from Capture Change Mysql is showing like Mon Sep 11 19:56:13 IST 2017. JoltTransform Json also same and

covertJSONtoSQL returning empty values in NiFi

隐身守侯 提交于 2019-12-11 01:35:50
问题 I am designing a work which takes a data from on database in MySQl to another database(MySQL) using ExecuteSQL processor followed up with ConvertAvroToJson then ConvertJsonToSQL then PutSQL as shown in below flow chart ConvertJSONToSQL returning the empty values like below INSERT INTO source_count (field1, field2, field3, field4, field5, field6, field7, field8, field9, field10, field11, field12) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) The processor configuration is what can be wrong in

Convert JSON to CSV in nifi

廉价感情. 提交于 2019-12-10 21:49:08
问题 I want to convert JSON files to CSV in nifi. We can achieve this in Python and other programming languages and have multiple articles on it. I have multiple JSON files and each file has different schema(one specific file will have one schema only). I can see there are templates to convert CSV to JSON and other conversions. But I didn't see any template to convert JSON data to CSV. I have gone through the article https://community.hortonworks.com/articles/64069/converting-a-large-json-file

How to turn off Nifi Processor Schedule

旧街凉风 提交于 2019-12-10 19:25:45
问题 I have GetHttp and InvokeHttp Nifi processors which initiates flows in Nifi, but I want them to get from the URLs only once and pass the data to the next process With processor configurations I am unable to turn off scheduling, how to achieve this. 回答1: InvokeHttp could be not initial and could be triggered by incoming flow file from other processor. So, you can put kind of sync logic before and after your InvokeHTTP processor. For example you can use Wait / Notify processors. 回答2: Apache

Does OkHttp send Authorization and other potentially sensitive headers on redirect?

ε祈祈猫儿з 提交于 2019-12-10 18:37:52
问题 I'm using OkHttp transitively through Apache NiFi. I'm attempting to determine how Authorization and other sensitive headers are handled on redirect. The only interaction that NiFi's InvokeHTTP processor has with OkHttp in regards to redirects is here, where it reads a processor property and sets the option on the OkHttpClientBuilder object: // Set whether to follow redirects okHttpClientBuilder.followRedirects(context.getProperty(PROP_FOLLOW_REDIRECTS).asBoolean()); Quickly searching through