- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Proper way to go about getting input data for python scripted processor from the dynamic properties?
- Labels:
-
Apache NiFi
Created on ‎11-09-2021 04:24 PM - edited ‎11-09-2021 04:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
I am trying to make a small scripted processor (via InvokeScriptedProcessor using a template created by @mburgess https://gist.github.com/mattyb149/fa02e1060b0a6dc9f2a3c119863e862b ) that acts as a separate reusable logger that uses the dynamic properties as the log info and message then writes it to disk. I tried simply using getattribute, but of course, the dynamic data had not been added as an attribute yet (and, honestly, I would rather it didn't, but I don't think I have much of a choice if I am not writing an actual Java processor?).
Is there a way to get this data using python if it has not yet been added as an attribute? If so, once I write my log file, is there a way to remove those properties from the flowFile instead of them being added as attributes once my processor has completed its objective?
Thanks,
-id
Created ‎11-10-2021 06:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got it all worked out. After searching through some of the tests in the nifi repo I came across a new methods for dealing with properties and I was able to figure out how to build what I wanted. Though, doing it in python felt... unstable at best, so I rewrote the processor in Groovy and now it's working just as I had hoped.
