Skip to main content
Dave0x1
Gold ⭐️⭐️
Mar 13, 2024 1:03 PM UTC
Question

Get a list of redis cache keys

Hi there ,

We are looking for a way to list all keys of redis cache thru nifi. The best solution we found was a groovy script from this article Get list of keys in NiFi DistributedMapCache 

The script looks good and exactly what we are looking for. But when we try to implement it, we get the following error:

Dave0x1_0-1710334742413.png

We are using the invokescriptprocessor and configure like this

Dave0x1_1-1710334742695.png

What are we missing here 😉 Or another solutions is also more than welcome.

Thank you in advanced.

Kind regards,

Dave

3 replies

DianaTorres
Community Manager
Community Manager
Mar 19, 2024 7:48 PM UTC

@mburgess @SAMSAL Hi! Do you have any insights here? Thanks!

Translate
Regards, Diana Torres, Senior Community Moderator
mburgess
Gold ⭐️⭐️⭐️
Gold ⭐️⭐️⭐️
Mar 19, 2024 7:58 PM UTC

The post you linked to has the command-line version of the Groovy script, it's based on my blog post at: https://funnifi.blogspot.com/2016/04/inspecting-your-nifi.html. You can put that code in your ExecuteScript (or InvokeScriptedProcessor in the onTrigger()). It might need slight alterations but should be pretty close. If you want to write them to a FlowFile you'll have to add that to the script as well.

Translate
Dave0x1
Dave0x1Author
Gold ⭐️⭐️
Mar 20, 2024 3:17 PM UTC

Hi there @mburgess thank you for your reply. Let play around with your solution and see if i can get it working and write the output to a flowfile 🤓

Translate