Member since
07-29-2020
574
Posts
323
Kudos Received
176
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 3576 | 12-20-2024 05:49 AM | |
| 3826 | 12-19-2024 08:33 PM | |
| 3622 | 12-19-2024 06:48 AM | |
| 2354 | 12-17-2024 12:56 PM | |
| 3114 | 12-16-2024 04:38 AM |
04-22-2024
05:47 AM
In my jolt spec its expecting customfield_10616 , so in my spec if you notice in the first shift Im using the expression *_* basically to make more dynamic but at least you have to have an underscore but if you think otherwise you can change it to whatever works for your data, for example you can change it to "customfield" , "customfield_*" , "*" , etc.
... View more
04-21-2024
03:35 PM
Hi @saquibsk , The below spec should put you on the right path if it doesnt completely solve your issue: [
// Assign isArray flag field when there is an array (index starts at 0)
{
"operation": "shift",
"spec": {
"id": "INTEGRATION_ID",
"*": {
"*_*": {
"@": "&(1,1)",
"0": {
"#true": "isArray"
}
}
}
}
}
,
//If the input is not an array assign default isArray=false
{
"operation": "default",
"spec": {
"isArray": "false"
}
}
,
//Depending on with isArray true of false:
//Transpose values into DEFECT_ROOT_CAUSE_List array
{
"operation": "shift",
"spec": {
"customfield": null,
"*": "&",
"isArray": {
"true": {
"@(2,customfield)": {
"*": {
"value": {
"@": "DEFECT_ROOT_CAUSE_List[]"
}
}
}
},
"false": {
"@(2,customfield)": "DEFECT_ROOT_CAUSE_List[]"
}
}
}
}
,
// Finally, get the last element of the array
{
"operation": "modify-overwrite-beta",
"spec": {
"DEFECT_ROOT_CAUSE": "=lastElement(@(1,DEFECT_ROOT_CAUSE_List))"
}
}
] If that helps please accept solution. Thanks
... View more
04-21-2024
05:53 AM
2 Kudos
Hi @mohdriyaz , I dont think you can accomplish this using the UpdateRecord processor as the added property has to be valid record path where the fields are specified explicitly. I can think of two options to do this: 1- Using JoltTransformJson: you can use "modify-overwrite-beta" spec to update a field but since the spec allows expression language and flowfile attribute evaluation you can reference the field name in the spec dynamically. In this case the spec will look like this: [
{
"operation": "modify-overwrite-beta",
"spec": {
"${col_name}":"9999"
}
}
] 2-Using ExecuteScript: You can write custom script like groovy, python ...etc. (depending on what Nifi version you are using) the script will basically read the json content into some dictionary or hashmap structure, read the flowfile attribute "col_name" into a variable and use that variable as a key to the field that you need to change in the json dictionary. Finally write then new content to the flowfile and pass to the success relationship. You can do error handling there as well and send any errors to the failure relationship. For more info on how to update flowfile content using ExecuteScript processor please refer to the "Reading and writing to/from a flow file" section under this link: https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-2/ta-p/249018 If you find this is helpful please accept solution. Thanks
... View more
04-19-2024
08:30 PM
1 Kudo
Hi, You can do this in different ways , here is one of them: [
{
"operation": "shift",
"spec": {
"@uniqueIdentifier": "_id",
"*": "&"
}
}
] Hope that helps.
... View more
04-12-2024
06:25 PM
So how are you determining the last file? Based on what? is a file created\updated date? or is it based on some sort order?
... View more
04-04-2024
10:31 AM
Hi @Ytch , The way I was able to get to work is through the following instruction: 1- After you have download the jdbc drive from here: https://learn.microsoft.com/en-us/sql/connect/jdbc/download-microsoft-jdbc-driver-for-sql-server?view=sql-server-ver15 you should be able to find the following dll "mssql-jdbc_auth-8.2.2.x64.dll" under the path: ..\sqljdbc_8.2\enu\auth\x64 2- Copy the dll and place under the JAVA Home path bin folder: .. \Java\jdk-21\bin 3- Adjust the DB Connection URL in the DBCPconnectionpool controller service by adding and setting "integrated security" flag to true: jdbc:sqlserver://{SQL SEVER NAME};databaseName={DB NAme};integratedSecurity=true; 4- Restart Nifi If that helps please accept solution. Thanks
... View more
03-20-2024
02:58 AM
1 Kudo
Actually there is a property called "Move Destination Directory" : As the description says on this properties: "this property is ignored unless the Completion Strategy is set to Move". The same rule applies on the Move Conflict Strategy as its only considered when the Completion Strategy is set to Move . If your Completion Strategy is set to None or Delete then both properties will be ignored.
... View more
03-20-2024
02:11 AM
2 Kudos
Hi, In 2.0 , the only thing that worked specially if you use out of the box ssl configuration is placing localhost in nifi.web.https.host property. To use the machine FQDN you need to configure new ssl truststore and keystore against that domain.
... View more
03-20-2024
02:07 AM
1 Kudo
Ok, I think I know what you mean now. Basically the GetFile is designed not to take any incoming connection as you can see in the processor documentation: The reason such restriction applies depend on how the processor works. The GetFile is designed as a trigger processor and it executes every time a file is placed in the target path, so providing an incoming relationship (wither through routeOnAttribute or any other processor) will break this rule because that means the GetFile will only work and Get the file when upper stream processor triggers that via sending flowfile which is not what this processor is designed to do. What you need is FetchFile processor given that you know the file you are looking for because this processor takes the full file path and not just a directory.
... View more
03-20-2024
01:39 AM
Hi , can you provide screenshot of the routeonattribute processor properties and relationship tabls configurations ? Also if you can provide a screenshot of the data flow and highlight what is missing? that would be very helpful to the community to pin point what exactly the problem is.
... View more