nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Bende <bbe...@gmail.com>
Subject Re: How to extract mutiple json properties/fields into processor properties?
Date Wed, 11 May 2016 19:01:04 GMT
Hi Keith,

If you have a single JSON document and want to extract data from it into
attributes, then the processor you would be interested in is
EvaluateJSONPath.

You add user defined properties to the processor, where the name will be
the id of the resulting attribute, and the value will be the json path to
extract.

For instance, if you added properties:

myId = $.id
myMsg = $.msg

That would extract the values of the "id" and "msg" fields from the JSON
and put them on to the flow file as attributes with the names "myId" and
"myMsg".

You would also want to set "Destination" to "flowfile-attribute".

-Bryan


On Wed, May 11, 2016 at 2:47 PM, Keith Lim <Keith.Lim@ds-iq.com> wrote:

> I want to extract from a single json blob (single record) of several
> properties into user defined properties.
> Can I use a single SplitJson processor to extract all of them?  How do you
> set that up?
> Or do I have to use one instance for each property extraction and flow
> through from one to another?
> I.e. if I have 3 properties that I want to extract, do I need to string 3
> SplitJson in a series?
>
> Thanks,
> Keith
>
>

Mime
View raw message