user7097216
user7097216

Reputation:

nifi fetching attribute from json file

I need to fetch the second attribute from a json file. and have tried to use 'evaluateJsonPath' processor and/or 'attributetoJson' processor, in both of which case i always get the whole line instead of single attribute.

in the json processor I added the property as 'bouncers_mobile_social' and value as '$.bouncers_mobile_social' yet getting the full line.

the sample json is {"mtimespent_other": 0.4, "bouncers_mobile_social": 45, "numvisitors_mobile_search": 647}

Please suggest

Upvotes: 0

Views: 237

Answers (1)

Andy
Andy

Reputation: 14194

I created a template demonstrating that a GenerateFlowFile processor which creates the JSON you provided and is passed to an EvaluateJSONPath processor with the property you provided works. Please check the configuration, typos, unexpected input data, etc.

NiFi flow demonstrating success enter image description here

Upvotes: 2

Related Questions