Support Questions
Find answers, ask questions, and share your expertise

How to route on attribute name?


Hello, how can I route flowfiles based on attribute name, not its value? I know what the attribute names will be but not their values. For example, I want to route all flowfiles with the attribute AmazonUserAddDetection to one flow, whereas those with the attribute GCPUser to a different flow.





Expert Contributor



Best way I can think of store that attribute name in another attribute. You can also use execute script processor and read the attribute name you are looking for as in  :


var myAttr = flowFile.getAttribute('filename')

and if the value is not  null then you can route the flow File to the desired relationship. For more information on how to use the execute script processor:

; ;