Thanks mark.

I have already followed the same approach but we are having more than fifty
fields, so thinking about is there any other way?

Thanks,
selvam R

On Thu, Jan 12, 2017 at 3:03 PM, Mark Payne <[email protected]> wrote:

> Selvam,
>
> You can use EvaluateJsonPath to extract the particular JSON value into an
> attribute
> and then use RouteOnAttribute to make sure that the field exists (and is
> valid if necessary).
>
> For example, for EvalualteJsonPath you might use something like:
>
> name: $.person.name
>
> And then in RouteOnAttribute, you could use:
>
> missing.name: ${name:isEmpty()}
>
> If you have multiple fields to check on RouteOnAttribute, you could create
> a separate Relationship
> for each rule by setting the "Routing Strategy" property to "Route to
> Property Name" or you could
> set the Routing Strategy to "Route to 'matched' if any matches" and then
> the 'unmatched' relationship would indicate that the JSON is valid.
>
> Thanks
> -Mark
>
>
> On Jan 12, 2017, at 8:46 AM, Selvam Raman <[email protected]> wrote:
>
> Hi,
>
> I will get array of json files. There are some fields which are mandatory
> in json file, if not present i should not process file.
>
> How can i achieve it in nifi.
>
> --
> Selvam Raman
> "லஞ்சம் தவிர்த்து நெஞ்சம் நிமிர்த்து"
>
>
>


-- 
Selvam Raman
"லஞ்சம் தவிர்த்து நெஞ்சம் நிமிர்த்து"

Reply via email to