blob: b521edbf70b757606a55a776b1fd044fea9bbd7c [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"></meta><title>JoltTransformJSON</title><link rel="stylesheet" href="../../../../../css/component-usage.css" type="text/css"></link></head><script type="text/javascript">window.onload = function(){if(self==top) { document.getElementById('nameHeader').style.display = "inherit"; } }</script><body><h1 id="nameHeader" style="display: none;">JoltTransformJSON</h1><h2>Description: </h2><p>Applies a list of Jolt specifications to the flowfile JSON payload. A new FlowFile is created with transformed content and is routed to the 'success' relationship. If the JSON transform fails, the original FlowFile is routed to the 'failure' relationship.</p><p><a href="additionalDetails.html">Additional Details...</a></p><h3>Tags: </h3><p>json, jolt, transform, shiftr, chainr, defaultr, removr, cardinality, sort</p><h3>Properties: </h3><p>In the list below, the names of required properties appear in <strong>bold</strong>. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the <a href="../../../../../html/expression-language-guide.html">NiFi Expression Language</a>.</p><table id="properties"><tr><th>Display Name</th><th>API Name</th><th>Default Value</th><th>Allowable Values</th><th>Description</th></tr><tr><td id="name"><strong>Jolt Transformation DSL</strong></td><td>jolt-transform</td><td id="default-value">Chain</td><td id="allowable-values"><ul><li>Cardinality <img src="../../../../../html/images/iconInfo.png" alt="Change the cardinality of input elements to create the output JSON." title="Change the cardinality of input elements to create the output JSON."></img></li><li>Chain <img src="../../../../../html/images/iconInfo.png" alt="Execute list of Jolt transformations." title="Execute list of Jolt transformations."></img></li><li>Default <img src="../../../../../html/images/iconInfo.png" alt=" Apply default values to the output JSON." title=" Apply default values to the output JSON."></img></li><li>Modify - Default <img src="../../../../../html/images/iconInfo.png" alt="Writes when key is missing or value is null" title="Writes when key is missing or value is null"></img></li><li>Modify - Define <img src="../../../../../html/images/iconInfo.png" alt="Writes when key is missing" title="Writes when key is missing"></img></li><li>Modify - Overwrite <img src="../../../../../html/images/iconInfo.png" alt=" Always overwrite value" title=" Always overwrite value"></img></li><li>Remove <img src="../../../../../html/images/iconInfo.png" alt=" Remove values from input data to create the output JSON." title=" Remove values from input data to create the output JSON."></img></li><li>Shift <img src="../../../../../html/images/iconInfo.png" alt="Shift input JSON/data to create the output JSON." title="Shift input JSON/data to create the output JSON."></img></li><li>Sort <img src="../../../../../html/images/iconInfo.png" alt="Sort input json key values alphabetically. Any specification set is ignored." title="Sort input json key values alphabetically. Any specification set is ignored."></img></li><li>Custom <img src="../../../../../html/images/iconInfo.png" alt="Custom Transformation. Requires Custom Transformation Class Name" title="Custom Transformation. Requires Custom Transformation Class Name"></img></li></ul></td><td id="description">Specifies the Jolt Transformation that should be used with the provided specification.</td></tr><tr><td id="name">Custom Transformation Class Name</td><td>jolt-custom-class</td><td></td><td id="allowable-values"></td><td id="description">Fully Qualified Class Name for Custom Transformation<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong><br/><br/><strong>This Property is only considered if </strong><strong>the [Jolt Specification] Property </strong></td></tr><tr><td id="name">Custom Module Directory</td><td>jolt-custom-modules</td><td></td><td id="allowable-values"></td><td id="description">Comma-separated list of paths to files and/or directories which contain modules containing custom transformations (that are not included on NiFi's classpath).<br/><br/><strong>This property expects a comma-separated list of resources. Each of the resources may be of any of the following types: directory, file.</strong><br/><br/><strong>Supports Expression Language: true (will be evaluated using variable registry only)</strong><br/><br/><strong>This Property is only considered if </strong><strong>the [Jolt Specification] Property </strong></td></tr><tr><td id="name">Jolt Specification</td><td>jolt-spec</td><td></td><td id="allowable-values"></td><td id="description">Jolt Specification for transform of JSON data. This value is ignored if the Jolt Sort Transformation is selected.<br/><strong>Supports Expression Language: true (will be evaluated using flow file attributes and variable registry)</strong></td></tr><tr><td id="name"><strong>Transform Cache Size</strong></td><td>Transform Cache Size</td><td id="default-value">1</td><td id="allowable-values"></td><td id="description">Compiling a Jolt Transform can be fairly expensive. Ideally, this will be done only once. However, if the Expression Language is used in the transform, we may need a new Transform for each FlowFile. This value controls how many of those Transforms we cache in memory in order to avoid having to compile the Transform each time.</td></tr><tr><td id="name"><strong>Pretty Print</strong></td><td>pretty_print</td><td id="default-value">false</td><td id="allowable-values"><ul><li>true</li><li>false</li></ul></td><td id="description">Apply pretty print formatting to the output of the Jolt transform</td></tr></table><h3>Relationships: </h3><table id="relationships"><tr><th>Name</th><th>Description</th></tr><tr><td>success</td><td>The FlowFile with transformed content will be routed to this relationship</td></tr><tr><td>failure</td><td>If a FlowFile fails processing for any reason (for example, the FlowFile is not valid JSON), it will be routed to this relationship</td></tr></table><h3>Reads Attributes: </h3>None specified.<h3>Writes Attributes: </h3><table id="writes-attributes"><tr><th>Name</th><th>Description</th></tr><tr><td>mime.type</td><td>Always set to application/json</td></tr></table><h3>State management: </h3>This component does not store state.<h3>Restricted: </h3>This component is not restricted.<h3>Input requirement: </h3>This component requires an incoming relationship.<h3>System Resource Considerations:</h3>None specified.</body></html>