Return-Path: X-Original-To: apmail-nifi-commits-archive@minotaur.apache.org Delivered-To: apmail-nifi-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 605ED1748E for ; Mon, 2 Mar 2015 14:53:26 +0000 (UTC) Received: (qmail 53021 invoked by uid 500); 2 Mar 2015 14:53:26 -0000 Delivered-To: apmail-nifi-commits-archive@nifi.apache.org Received: (qmail 52984 invoked by uid 500); 2 Mar 2015 14:53:26 -0000 Mailing-List: contact commits-help@nifi.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nifi.incubator.apache.org Delivered-To: mailing list commits@nifi.incubator.apache.org Received: (qmail 52918 invoked by uid 99); 2 Mar 2015 14:53:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Mar 2015 14:53:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 02 Mar 2015 14:53:24 +0000 Received: (qmail 51551 invoked by uid 99); 2 Mar 2015 14:53:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Mar 2015 14:53:04 +0000 Date: Mon, 2 Mar 2015 14:53:04 +0000 (UTC) From: "Mark Payne (JIRA)" To: commits@nifi.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (NIFI-360) Create Processors to work against JSON data MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/NIFI-360?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mark Payne resolved NIFI-360. ----------------------------- Resolution: Fixed > Create Processors to work against JSON data > ------------------------------------------- > > Key: NIFI-360 > URL: https://issues.apache.org/jira/browse/NIFI-360 > Project: Apache NiFi > Issue Type: New Feature > Components: Extensions > Reporter: Aldrin Piri > Assignee: Aldrin Piri > Priority: Minor > Labels: processor > Fix For: 0.0.2 > > > I have created two Processors, EvaluateJsonPath and SplitJson which are analogs of the functionality provided through EvaluateXPath and SpiltXML. > Both are powered primarily around the usage of [JsonPath by Jayway|https://github.com/jayway/JsonPath]. > Their capability descriptions are provided below: > {panel:title= EvaluateJsonPath} > Evaluates one or more JsonPath expressions against the content of a FlowFile. The results of those expressions are assigned to FlowFile Attributes or are written to the content of the FlowFile itself, depending on configuration of the Processor. JsonPaths are entered by adding user-defined properties; the name of the property maps to the Attribute Name into which the result will be placed (if the Destination is flowfile-attribute; otherwise, the property name is ignored). > The value of the property must be a valid JsonPath expression. If the JsonPath evaluates to a JSON array or JSON object and the Return Type is set to 'scalar' the FlowFile will be unmodified and will be routed to failure. A Return Type of JSON can return scalar values if the provided JsonPath evaluates to the specified value and will be routed as a match. If Destination is 'flowfile-content' and the JsonPath does not evaluate to a defined path, the FlowFile will be routed to 'unmatched' without having its contents modified. If Destination is flowfile-attribute and the expression matches nothing, attributes will be created with empty strings as the value, and the FlowFile will always be routed to 'matched.' > {panel} > {panel:title=SplitJson} > Splits a JSON File into multiple, separate FlowFiles for an array element specified by a JsonPath expression. Each generated FlowFile is comprised of an element of the specified array and transferred to relationship 'split, with the original file transferred to the 'original' relationship. If the specified JsonPath is not found or does not evaluate to an array element, the original file is routed to 'failure' and no files are generated. > {panel} > One item of note is the transitive dependency of ASM through Json-Smart through JsonPath. > I have included, what I believe is needed to appropriately make use of this item in the LICENSE. Review of its correctness would is requested. > Any feedback is appreciated. Thanks! -- This message was sent by Atlassian JIRA (v6.3.4#6332)