Created 05-20-2023 05:01 AM
Hey there,
I need some help with configuring EvaluateJsonpath because I'm having trouble with it. Everything else seems to be working fine, but I always get stuck at this part. I've tried looking for solutions online, but none of them seem to work or they're just outdated. It's possible that I messed up something in the other function blocks, but they still work if I remove the EvaluateJsonpath. Any ideas?
This is the json file:
{ "random": 3171504720, "als": 29024, "mic": 47334, "gyro": { "x": -26, "y": 8, "z": 1 }, "accel": { "x": -1829, "y": 447, "z": 16802 } }
Created 05-22-2023 05:56 AM
Welcome to the community @JeffTheMilkMan. While you wait for a more knowledgeable response, I'll provide a link to Parsing XML Logs With Nifi – Part 1 of 3 in case it can be of assistance.
Created 05-22-2023 09:07 AM
What you are doing is mostly correct. I see a couple of items that may be creating some issues, e.g. mis-assigned values.
For example, you are assigning accel.x to all three attributes values ax, ay, az. But it seems like you probably meant to assign ax = $.accel.x , ay =$.accel.y , az =$.accel.z
It seems you've mixed up "random" and "rand". The field name in your JSON is "random" so your attribute assignment should be rand = $.random
Where is "btn" in your JSON?