<?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 convert plain text to JSON in Nifi in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-convert-plain-text-to-JSON-in-Nifi/m-p/183816#M73256</link>
    <description>&lt;P&gt;Thanks Matt! Good to know that!&lt;/P&gt;</description>
    <pubDate>Thu, 11 Jan 2018 05:28:28 GMT</pubDate>
    <dc:creator>fangzhouye94</dc:creator>
    <dc:date>2018-01-11T05:28:28Z</dc:date>
    <item>
      <title>How to convert plain text to JSON in Nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-convert-plain-text-to-JSON-in-Nifi/m-p/183814#M73254</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;&lt;P&gt;I have problem casting a plain text which is already in valid JSON format to JSON data type.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/45770-textdata.png"&gt;textdata.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I want to it to convert the content type from text/plain to application/json.&lt;/P&gt;&lt;P&gt;I failed to do so by both &lt;STRONG&gt;ConvertRecord&lt;/STRONG&gt; and &lt;STRONG&gt;AttributesToJSON.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For &lt;STRONG&gt;ConvertRecord&lt;/STRONG&gt;, since it is not in any data format, none of the reader applies on such Flowfile.&lt;/P&gt;&lt;P&gt;For &lt;STRONG&gt;AttributesToJSON,&lt;/STRONG&gt; I tried to use EvaluateJsonPath to put entire text into an attribute then used AttributesToJSON but the JSON object will become totally messed up especially with arrays and strings. (The actual data I am working with is more complicated than this example)&lt;/P&gt;&lt;P&gt;Anyone has good idea to do this?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 04:01:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-convert-plain-text-to-JSON-in-Nifi/m-p/183814#M73254</guid>
      <dc:creator>fangzhouye94</dc:creator>
      <dc:date>2018-01-09T04:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert plain text to JSON in Nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-convert-plain-text-to-JSON-in-Nifi/m-p/183815#M73255</link>
      <description>&lt;P&gt;Here the MIME type for your flow file is set to text/plain, it is an attribute on the flow file called "mime.type". You can use an UpdateAttribute processor to set "mime.type" to "application/json".&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 06:05:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-convert-plain-text-to-JSON-in-Nifi/m-p/183815#M73255</guid>
      <dc:creator>mburgess</dc:creator>
      <dc:date>2018-01-09T06:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert plain text to JSON in Nifi</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-convert-plain-text-to-JSON-in-Nifi/m-p/183816#M73256</link>
      <description>&lt;P&gt;Thanks Matt! Good to know that!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jan 2018 05:28:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-convert-plain-text-to-JSON-in-Nifi/m-p/183816#M73256</guid>
      <dc:creator>fangzhouye94</dc:creator>
      <dc:date>2018-01-11T05:28:28Z</dc:date>
    </item>
  </channel>
</rss>

