Member since
06-05-2024
7
Posts
4
Kudos Received
3
Solutions
My Accepted Solutions
| Title | Views | Posted |
|---|---|---|
| 1144 | 01-20-2025 02:13 AM | |
| 4331 | 06-06-2024 01:43 AM | |
| 4380 | 06-05-2024 01:22 AM |
11-20-2025
11:06 PM
Hi everyone, I hope you’re doing well. I am working on a dataflow in Apache NiFi 1.18, and I need to retrieve the queue size information (flowfile count and content size) directly within NiFi itself, not via an external script or Postman. I know that the NiFi REST API provides this data, and I can access it successfully using external tools. However, my goal is to access queue metrics from inside NiFi, for example through processors like InvokeScriptedProcessor, QueryNiFiReportingTask, or any other built-in mechanism, without sending an external REST API request from outside NiFi. Is there a recommended approach, processor, or reporting task that allows NiFi to read its own queue sizes internally? If not, what would be the best practice to achieve this? Any guidance or examples would be greatly appreciated. Thank you in advance!
... View more
01-28-2025
08:00 AM
@enguias Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future. Thanks.
... View more
06-06-2024
02:44 AM
1 Kudo
@Thar11027 yes, but it will be more complex: you can put a shift operation and using the "*" wildcard. So if for example you do this: [
{
"operation": "shift",
"spec": {
"*": {
"*/*": "[&1].&", //with a '/' in the middle somewhere
"/*":"[&1].&", //with a '/' at the start followed by something
"*/":"[&1].&" //with a '/' at the end following something
}
}
}
] You will obtain all the desired fields, so it will be more easy to do the manual substitution(try it on the jolt demo site). Know that if you want to make it full automated, it will be a little more difficult, because then you would have to manipulate the string of the field. If you are interested in that I really suggest you to look at the last example on the guide I already sent you (My Guide). (I don't know if maybe it will be more appropriate to open another question about this other problem, because the topic changed and maybe if someone with the same problem is searching for it, it can be found)
... View more
06-05-2024
08:56 AM
Hi @mstfo , Firstly it seems that the output you have after the replacetext processor isn't really a json, because of the missing commas (' , ') between the fields. If your output is exactly like this, it will be necessary to add those missing commas so then you can get a json like this: [
{
"Name": "Gta V",
"Type": "Xyz",
"content": "{\"Game\":{\"Subject\":[{\"Time\":{\"@value\":\"201511021057\" }}]}}"
}
] To obtain a json like this you can either: try to change the logic when you get the data from the database; try to add the commas manually. The first option is the quicker solution, but there is the possibility that maybe you can't change the input you receive from the db, so perhaps you have to manually change it yourself. Anyway, in case you manage to obtain a correct json from your input, then you can manipulate the string using the functions in the beta operations in jolt (like the =split()) and then reassemble the wanted json. I wrote a guide and in the very last example i did, there is a similar case, so if you want go there and give it a look -> JOLT guide .
... View more