Support Questions

Find answers, ask questions, and share your expertise

Get a list of redis cache keys

avatar
Rising Star

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 3

avatar
Community Manager

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


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
Master Guru

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.

avatar
Rising Star

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 🤓