With the ConvertRecord processor I have converted a csv text file to a json file which looks like this:
[
{"A":1001,"B":"20170101","C":0.3},
{"A":1001,"B":"20170102","C":0.1},
.....]
I tried with evaluate Json Path to get the pathes like:
a: $.A
b: $.B
....
But I got only null values.
Im not sure do I need to split this JSON file with SplitJson processor before using evaluateJsonPath and when yes, what do I need to enter in the processor?
I tried
$.*
But it didn't work.
Or do I just need to use other JsonPath values in evaluateJsonPath processor?
You can open up a window to evaluate JSONPath expressions by going to Edit -> Find -> "Evaluate JSONPath Expression...". If a JSON file is open, it will use this file to evaluate the expression. If you have JSONPath expressions as Strings in code, use "inject language" and say this is a JSONPath expression.
Apache NiFi is an integrated data logistics platform for automating the movement of data between disparate systems. It provides real-time control that makes it easy to manage the movement of data between any source and any destination.
A JSONPath expression specifies a path to an element (or a set of elements) in a JSON structure. Paths can use the dot notation: $.store.book[0].title. or the bracket notation: $['store']['book'][0]['title']
The attributes are key/value pairs that act as the metadata for the FlowFile, such as the FlowFile filename. The content is the actual data or the payload of the file. Provenance is a record of what has happened to the FlowFile.
thx for the answers. I found the solution. I had already the right way in my mind, so it was right to split the JSON at the path:
$.*
My mistake was a typo in the evaluateJsonPath processor. So after splitting I could just evaluate the json path like this:
a: $.A
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With