java - Use pattern in getAttribute in NiFi -


how can use pattern in getattribute of flowfile?

i going write processor receives flowfiles listentcp , listenudp processors. listentcp has property tcp.sender , listenudp hash property udp.sender . how sender property of flowfile. current solution is:

string sender = flowfile.getattribute("tcp.sender"); if(sender!=null && !sender.isempty()) {      // } else {     sender = flowfile.getattribute("udp.sender");     if(sender!=null && !sender.isempty()) {         //do     } } 

how can avoid using if. need this:

string sender = flowfile.getattribute("*.sender"); 

there isn't way attribute based on pattern. if there was, return list of multiple attribute values, , still have go through list , find 1 interested in.

you make custom processor require attribute "network.sender" , after listentcp , listenudp, have updateattribute processor each of them renames "tcp.sender" "network.sender" , "udp.sender" "network.sender".


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -