Member since
09-27-2018
138
Posts
23
Kudos Received
10
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
9744 | 02-28-2021 10:23 PM | |
1942 | 02-08-2021 11:53 PM | |
31781 | 12-16-2020 11:31 PM | |
7611 | 12-14-2020 11:02 PM | |
4844 | 12-14-2020 12:18 AM |
12-13-2020
10:58 PM
@GMAN You can do this with UpdateAttribute. In my example: Date_Time ==> ${YourUnixTimestamp:toDate():format('YYYY-MM-dd hh:mm:ss.SSS', 'UTC')} YourDate_YYYY-MM-dd ==> ${YourUnixTimestamp:toDate():format('YYYY-MM-dd')} You can check the result here: https://www.unixtimestamp.com/index.php But you have to remove the last three digits of the value. Hope this helps!
... View more
12-08-2020
11:04 AM
thank you very much! This works.
... View more
12-06-2020
10:50 PM
1 Kudo
@dzbeda Try it with: /*:Event/*:System/*:Channel
... View more
11-08-2020
01:37 PM
great job dude, thanks! 🙂
... View more
11-02-2020
03:40 AM
1 Kudo
@kumar79 Maybe you could reset the state via NiFi-REST-API at beginning of your flow? Hava a look here: https://nifi.apache.org/docs/nifi-docs/rest-api/index.html Could be: POST "https://[ip:port]/nifi-api/processors/${pg-id}/state/clear-requests" This is the request which NiFi itself uses when you go to the processor in the UI and choose the menu-option "view state" -> "clear state".
... View more
10-26-2020
04:35 AM
1 Kudo
@MKS_AWS You can do this in different ways. Possibility 1 Create variables in VariableRegistry containing your authorization data. Possibility 2 Create a parameter list and define your authorization data there in parameters. In both ways you can use the variables or parameters inside the InvokeHTTP. Here an example with variables. If you get your authorization data from a database table just set them into attributes and use them in the same way.
... View more
10-15-2020
04:20 AM
Thanks for your help @ashinde ! I see I was looking at the wrong section of rest-api. OK I have to go on nifi rest-api section flow/history. I will have a look on the nifi.properties but because my report is running every night I suppose the purging doesn't matter. Second option you mentioned concerning when a flow was brought to registry doesn't interest... at the moment.
... View more
10-05-2020
12:10 AM
@PVVK OK, it covers possible alternative cases. Got it! Thanks for this explanation.
... View more
10-02-2020
01:23 AM
Hello, Suddenly few processors in NiFi is not recording the data provenance information of its runs. Could you please let me know what are the checks to be done to check this issue? Thank you in advance
... View more
09-30-2020
12:32 PM
Hi @justenji ! Please take a look at the below code and tell me if it is working or if you need any further upgradations. As of now, I have converted the timestamps and added dnr_group. import java.nio.charset.StandardCharsets import org.apache.nifi.components.PropertyValue import groovy.json.JsonSlurper import groovy.json.JsonOutput flowFile = session.get() if (!flowFile) return try { def jsonSlurper = new JsonSlurper(); def jsonOutput = new JsonOutput(); def input = flowFile.read().withStream { data -> jsonSlurper.parse(data) } def pattern1 = 'yyyyMMddHHmmss'; def tz1 = 'GMT+0200'; def pattern2 = 'yyyy-MM-dd HH:mm:ss'; def tz2 = 'GMT'; input.stand = convertDatePattern(input.stand,pattern1,TimeZone.getTimeZone(tz1),pattern2,TimeZone.getTimeZone(tz2)); for(int i=0;i<input.table.size();i++){ input.table[i].elem_stand = convertDatePattern(input.table[i].elem_stand,pattern1,TimeZone.getTimeZone(tz1),pattern2,TimeZone.getTimeZone(tz2)); def dnr = input.table[i].dnr.replaceAll('\\(|\\)',''); def group = input.table[i].group.replaceAll('\\(|\\)',''); if(dnr.toInteger() < 10){ dnr = '0'+dnr; } if(group.toInteger() < 10){ group = '0'+group; } input.table[i].dnr_group = "V-"+dnr+"-"+group; input.table[i].remove('dnr'); input.table[i].remove('group'); } flowFile = session.write(flowFile, { outputStream -> outputStream.write(jsonOutput.toJson(input).toString().getBytes(StandardCharsets.UTF_8)) }as OutputStreamCallback); session.transfer(flowFile, REL_SUCCESS); } catch (e) { log.error('Error Occured,{}', e) session.transfer(flowFile, REL_FAILURE) } def convertDatePattern(String input, String pattern1, TimeZone tz1, String pattern2, TimeZone tz2){ return new Date().parse(pattern1,input,tz1).format(pattern2,tz2).toString(); }
... View more