Getting data from xml respose in nifi -




after strating invokehttp processor response data that:

<response xmlns=""> <result> <responsestatus>false</responsestatus> <error> <errorcode>-7</errorcode> <errordescription>not foudn</errordescription> </error> </result> </response> 

i needed value of errorcode (-7) have added evaluatexpath processor attribute errorcode used command //error/errorcode/text() can't reitreive data of errorcode in attribute errorcode( in flowfile after processing evaluatexpath errorcode attribute doesn't have value ,is empty string) how can value of errrorcode?

to extract desired value, use xpath expression //errorcode. return string value -7. selecting destination flowfile-attribute, can keep flowfile content constant , put new value in flowfile attribute (i.e. named attribute).

configuration of evaluatexpath

you can chain matched relationship updateattribute processor has expression ${attribute:tonumber()} convert numerical representation, i.e. ${attribute:tonumber():plus(10)} return 3.

output of logattribute





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -