How can update a flow file attribute value data type (String to byte) in the NiFi

Viewed 34

I am using NiFi version 1.8.0.3.3.0.0-165, and not getting an idea for converting an attribute value data type (String to byte).

Is it possible to convert the data type of NiFi flow file attribute.

1 Answers

for attributes you can use this guide Apache NiFi Expression Language Guide if you don't find the solution you can use a groovy script to load your attribute and do whatever you want

def flowFile = session.get()
if(!flowFile) return
    
    def val = flowFile.getAttribute('yourattribue')
    //mod your val 
    flowFile = session.putAttribute(flowFile, 'yourattributeout', yourattributeout)
    session.transfer(flowFile, REL_SUCCESS)
Related