Member since
07-29-2020
574
Posts
320
Kudos Received
175
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
366 | 12-20-2024 05:49 AM | |
424 | 12-19-2024 08:33 PM | |
412 | 12-19-2024 06:48 AM | |
331 | 12-17-2024 12:56 PM | |
326 | 12-16-2024 04:38 AM |
09-12-2022
08:49 AM
Hi, To help you I think we need to understand your question better, so you have a json input like you specified above, from what I understand there are two parts you are trying to solve: 1- You need to process this json if it meets certain condition, in this case the condition is if the Json attribute "dataSourceName" is equal to "Standard CPU Utilization Network Cisco". 2- If the json meets the condition above then you want to apply Json Jolt Transformation to produce the output you specified, is this correct? To answer the first part, I'm not sure if you can have conditional json jolt so you can do the first and the second part in one processor. I think what you need to do is use EvaluateJsonPath processor to extract the value that you need -dataSourceName- into a flow file attribute then use RouteOnAttribute to check the value so that if meets the condition (="Standard CPU Utilization Network Cisco" ) the match relationship will direct the flow file to the Jolt transformation processor to apply needed transformation , otherwise the flowfile will be dropped or direct to unmatched relationship for farther processing. For the second part, its not clear if you need the exact output you specified no matter what the other values in the input json are , which in this case you can use the ReplaceText processor just to replace the whole input json with the expected out, Or you actually need json jolt transformation to capture different values for each json input which in this case its not clear how you are selecting your values, for example on what basis you decided that the value of "Datapoints" is "MemoryFree", also how the attribute "Datas" has the value of "Values[3]". So you need to clarify that better so we can help you with creating the proper jolt spec. Hope that helps. Thanks
... View more
09-12-2022
07:38 AM
Hi, I dont think you need the asterisk "*" in the spec, since you need it on the first level and you dont need to reference any other fields. Just have your spec as follows: [
{
"operation": "modify-default-beta",
"spec": {
"target.organisation": "${target.organisation}"
}
}
]
... View more
09-12-2022
02:58 AM
I have found the solution, for the changing parts of the url https://mycompany\.my\.app/api/public/v1/organisations/([0-9a-z]+)/detailedLaborcosts.*
... View more
09-09-2022
11:01 AM
1 Kudo
Hi, Not sure how you get the URL but if its hard coded in the InvokeHttp Remote URL property , then you can use expression language to set up your parameters as follows: ${literal('https://api.aa/reports/api/order_report/?format=json&dateFrom=#DATEFROM&dateTo=#DATETO'):
replace('#DATEFROM',${now():format('yyyy-MM-dd')}):
replace('#DATETO',${now():toNumber():minus(432000000):format("yyyy-MM-dd")})} Notice: - you can set the date format as desired, in my case I assumed that its in yyyy-MM-dd format. - To subtract 5 days from the current date you have to convert the date to number , then subtract 5 days in milliseconds (1day = 86,400,000 mls ). Hope that helps, if it does please accept solution. Thanks
... View more
09-06-2022
07:23 AM
Hi, Thanks for the reply.. "fileSize" returns size of the flowfile i need size of the file/object listed from lists3.
... View more
09-04-2022
04:19 PM
@araujo Thank you for the help.. It works.
... View more
09-04-2022
01:08 PM
Thanks Mr @SAMSAL for the insight. I learned from it because i was even thinking of telling him to use EvaluateJsonPath & ReplaceText processor.
... View more
09-03-2022
01:44 PM
Hi , where is the key,value pair are stored? Are they stored as a flowfile attribute or in the input json? there are processors like RouteOnAttribute in case they are stored as attributes where you can create your condition as dynamic property and provide the logical expression there. If the key\value pair is part of the json you can use Extract Text to Extract the key\value pair as an attribute then use RouteOnAttribute or you can try to use RouteOnContent if that will work? If you find this helpful, please accept solution. Thanks Samer
... View more
09-01-2022
12:05 PM
Hi , you can use QueryRecord Processor. For more information please see: https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.12.1/org.apache.nifi.processors.standard.QueryRecord/additionalDetails.html If you find this helpful please accept solution. Thanks
... View more
08-31-2022
03:02 PM
1 Kudo
Hi , Not sure if this is possible with out of the box processor. I can think of ReplaceText first to replace different delimiters like (-) or white-space (\s) to common delimiter like (,) however if there is a white space before or after other delimiters like (-) or (,) its not going to work. Another option is to use ExecuteScript processor where you try to read each line (after the header) from the flowfile content and then use string split function and try it with different delimiter, once you get two array elements you construct your new string with the new column header and delimiter and transfer to the success relationship.
... View more