<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to use Apache NiFi EvaluateJsonPath for JSON to CSV/Text extract in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207465#M66201</link>
    <description>&lt;P&gt;Can you post you json file content ? &lt;/P&gt;&lt;P&gt;Test your json path definition at &lt;A href="http://jsonpath.com/" target="_blank"&gt;http://jsonpath.com/&lt;/A&gt;? , is easy and debug any issues with the json format. &lt;/P&gt;</description>
    <pubDate>Wed, 13 Jun 2018 06:52:23 GMT</pubDate>
    <dc:creator>opreaadrian1</dc:creator>
    <dc:date>2018-06-13T06:52:23Z</dc:date>
    <item>
      <title>How to use Apache NiFi EvaluateJsonPath for JSON to CSV/Text extract</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207461#M66197</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I am getting my arse kicked by the &lt;STRONG&gt;EvaluateJsonPath&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt; So the task is to be able to extract some json attribute values into a CSV format or a text format that will be used for inserting into file, db ,etc..  &lt;/P&gt;&lt;P&gt;So here is what i got so far: &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GetFile&lt;/STRONG&gt; (it reads a json file) --&amp;gt; &lt;STRONG&gt;SplitJson&lt;/STRONG&gt; --&amp;gt; &lt;STRONG&gt;EvaluateJsonPath&lt;/STRONG&gt; --&amp;gt; &lt;STRONG&gt;PutFile&lt;/STRONG&gt; (i will throw a merge in between after i get after the &lt;STRONG&gt;EvaluateJsonPath&lt;/STRONG&gt; to work "understand how it work").&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The json used is:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;- this is just a dummy json data&lt;/P&gt;&lt;PRE&gt;{
  "results": [
    {
      "gender": "female",
      "name": {
        "title": "ms",
        "first": "juliette",
        "last": "schmitt"
      },
      "location": {
        "street": "7260 esplanade du 9 novembre 1989",
        "city": "le havre",
        "state": "lot",
        "postcode": 58491
      },
      "email": "juliette.schmitt@example.com",
      "login": {
        "username": "smallcat938",
        "password": "horizon",
        "salt": "fvaSIrep",
        "md5": "3d1a182db3002dc88cd54b258838aa89",
        "sha1": "71600ad7a6f65ec00fed7521bcf3d943a87a8172",
        "sha256": "cd9bfc086b5b83a935c99b496c27fc58716521a43c2630e286f87147e4b4dd8a"
      },
      "dob": "1959-08-16 23:11:26",
      "registered": "2010-07-16 20:27:45",
      "phone": "04-09-99-35-16",
      "cell": "06-87-17-31-45",
      "id": {
        "name": "INSEE",
        "value": "259755098491 56"
      },
      "picture": {
        "large": "https://randomuser.me/api/portraits/women/71.jpg",
        "medium": "https://randomuser.me/api/portraits/med/women/71.jpg",
        "thumbnail": "https://randomuser.me/api/portraits/thumb/women/71.jpg"
      },
      "nat": "FR"
    }
  ],
  "info": {
    "seed": "ca021f036c48503a",
    "results": 1,
    "page": 1,
    "version": "1.1"
  }
}
&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;1- GetFile setup:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/23488-getfile.png" target="_blank"&gt;Getfile&lt;/A&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="23488-getfile.png" style="width: 803px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16957i3E1BBDC744792F8D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="23488-getfile.png" alt="23488-getfile.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2- SplitJson setup:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/23489-splitjson.png" target="_blank"&gt;SplitJson&lt;/A&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="23489-splitjson.png" style="width: 806px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16958i4A44668E3918CF43/image-size/medium?v=v2&amp;amp;px=400" role="button" title="23489-splitjson.png" alt="23489-splitjson.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3- EvaluateJsonPath&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/23490-evaluatejsonpath.png" target="_blank"&gt;EvaluateJsonPath&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="23490-evaluatejsonpath.png" style="width: 803px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16959iF3E20CE51167ABC4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="23490-evaluatejsonpath.png" alt="23490-evaluatejsonpath.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Note: this one is working!&lt;/P&gt;&lt;P&gt;Now adding a new property to the &lt;B&gt;EvaluateJsonPath&lt;/B&gt; gets me stuck&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/23491-eval1.png" target="_blank"&gt;ErrorJsonPaths&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The documentation is not very illustrative on how this should be used and i am not an json expert. &lt;/P&gt;&lt;P&gt;I am trying to understand how the does the twitter template actually does it ? &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/23492-twitt.png" target="_blank"&gt;twitt.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-where multiple paths are declared.&lt;/P&gt;&lt;P&gt;thanks all&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 04:33:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207461#M66197</guid>
      <dc:creator>opreaadrian1</dc:creator>
      <dc:date>2019-08-18T04:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Apache NiFi EvaluateJsonPath for JSON to CSV/Text extract</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207462#M66198</link>
      <description>&lt;P&gt;If you set the Destination to flowfile-content, you can have only one JSON Path expression. You could set the Destination to flowfile-attribute instead, then each JSON Path will be extracted to the named attribute value. If you need the results in the content of the Flow File, use a ReplaceText processor afterwards to collect the attribute values into the content.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 12:25:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207462#M66198</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-08-08T12:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Apache NiFi EvaluateJsonPath for JSON to CSV/Text extract</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207463#M66199</link>
      <description>&lt;P&gt;Ok ,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="23497-406989-big-hugs-elmo.jpg" style="width: 333px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16956i06AA9C69A9E3CA9F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="23497-406989-big-hugs-elmo.jpg" alt="23497-406989-big-hugs-elmo.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; I need to give you a big hug !!! &lt;/P&gt;&lt;P&gt;I was going out of my mind with this !!! Could not imagine why was not working !&lt;/P&gt;&lt;P&gt;thank you so much ! you made my day &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 04:33:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207463#M66199</guid>
      <dc:creator>opreaadrian1</dc:creator>
      <dc:date>2019-08-18T04:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Apache NiFi EvaluateJsonPath for JSON to CSV/Text extract</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207464#M66200</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/12029/opreaadrian1.html"&gt;Adrian Oprea&lt;/A&gt; &lt;BR /&gt;Hi Adrian, I am trying your example with the JSON data you've provided but I am getting an error in SplitJSON processor as below:&lt;BR /&gt;2018-06-12 13:44:33,320 ERROR [Timer-Driven Process Thread-3] o.a.nifi.processors.standard.SplitJson SplitJson[id=f57cffea-0163-1000-2a56-c76e963c1ea2] FlowFile StandardFlowFileRecord[uuid=70f23330-cb67-472f-9ccc-2d9f1ecb3d5f,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1528832661718-625, container=default, section=625], offset=0, length=18],offset=0,name=40718.toc,size=18] &lt;STRONG&gt;did not have valid JSON content.&lt;/STRONG&gt;&lt;BR /&gt;Any pointers please?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 02:48:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207464#M66200</guid>
      <dc:creator>vikassingh1909</dc:creator>
      <dc:date>2018-06-13T02:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Apache NiFi EvaluateJsonPath for JSON to CSV/Text extract</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207465#M66201</link>
      <description>&lt;P&gt;Can you post you json file content ? &lt;/P&gt;&lt;P&gt;Test your json path definition at &lt;A href="http://jsonpath.com/" target="_blank"&gt;http://jsonpath.com/&lt;/A&gt;? , is easy and debug any issues with the json format. &lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2018 06:52:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207465#M66201</guid>
      <dc:creator>opreaadrian1</dc:creator>
      <dc:date>2018-06-13T06:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Apache NiFi EvaluateJsonPath for JSON to CSV/Text extract</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207466#M66202</link>
      <description>&lt;P&gt;Thanks for your reply. Please find attached the JSON file: &lt;A href="https://community.cloudera.com/legacyfs/online/attachments/77675-json.jpeg"&gt;json.jpeg&lt;/A&gt; &lt;BR /&gt;In the SplitJson processor, the JsonPath Expression is "$.results" so I can grab all the 25 features/columns inside of it. But where to provide the "$.info" so I can grab the seed, results, page, and version columns?&lt;BR /&gt;&lt;BR /&gt;Thanks for your time.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jun 2018 04:04:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207466#M66202</guid>
      <dc:creator>vikassingh1909</dc:creator>
      <dc:date>2018-06-14T04:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Apache NiFi EvaluateJsonPath for JSON to CSV/Text extract</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207467#M66203</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/12522/hbecker.html" nodeid="12522"&gt;@Hellmar Becker&lt;/A&gt;,thanks for the info. But can you please give an example what should be the jsonpath like..?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 12:18:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207467#M66203</guid>
      <dc:creator>rajatpuchnanda1</dc:creator>
      <dc:date>2018-06-20T12:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Apache NiFi EvaluateJsonPath for JSON to CSV/Text extract</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207468#M66204</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/81293/vikassingh1909.html" nodeid="81293"&gt;@Vikas Singh&lt;/A&gt; , SplitJson Processor is used to split Json Array and EvaluateJsonPath is used to extract Json fields as attribute or content. In your case: Step 1:Use EvaluateJsonPath Processor to extract info fields of Json. For example: is you want to extarct info fileds: .$info.seed,.$info.page,.$info.version,.$info.results and save it as Flowfile Attribute. Step 2:Use SplitJson Processor :$.results Step 3:USe EvaluateJsonPath Processor to extract Json Array fields.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 13:43:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-use-Apache-NiFi-EvaluateJsonPath-for-JSON-to-CSV-Text/m-p/207468#M66204</guid>
      <dc:creator>bhandari_surbhi</dc:creator>
      <dc:date>2018-08-14T13:43:58Z</dc:date>
    </item>
  </channel>
</rss>

