<?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: NIFI JSON event extraction only integers from string in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/270030#M207239</link>
    <description>&lt;P&gt;How about when i have multiple fields such as {&lt;BR /&gt;"x":"avc123.abc.com",&lt;BR /&gt;"z":"24 - ny"&lt;BR /&gt;}&lt;BR /&gt;and I would like to only targer "x" value for "123" and the rest won't get affected such as "z"&lt;BR /&gt;so the expected output would be&amp;nbsp;{&lt;BR /&gt;"x":"avc123.abc.com",&lt;BR /&gt;"z":"24 - ny",&lt;BR /&gt;"y":"123"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Please note that the "y" value only targeted the "x" and the z shouldn't be picked up?&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Sep 2019 13:27:17 GMT</pubDate>
    <dc:creator>ANMAR</dc:creator>
    <dc:date>2019-09-09T13:27:17Z</dc:date>
    <item>
      <title>NIFI JSON event extraction only integers from string</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/269976#M207204</link>
      <description>&lt;P&gt;I have a JSON data coming as {"x":"avc123.abc.com"} I would like to have a processor in nifi to extract only the integer (123) from the entire value and output it from the process&lt;/P&gt;
&lt;P&gt;secondly, I would like that integer value (123) to be added in the JSON event with different keys such as the final JSON event would be {"x":"avc123.abc.com" "y":"123" }&lt;/P&gt;
&lt;P&gt;I already tried routetext and extract text but it didn't work.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 06:13:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/269976#M207204</guid>
      <dc:creator>ANMAR</dc:creator>
      <dc:date>2019-09-09T06:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI JSON event extraction only integers from string</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/269992#M207212</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/69313"&gt;@ANMAR&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to use &lt;STRONG&gt;ExtractText&lt;/STRONG&gt; processor and matching &lt;STRONG&gt;regex&lt;/STRONG&gt; to extract only the integer value.&lt;/P&gt;&lt;P&gt;---------------------------------------------&lt;/P&gt;&lt;P&gt;Add new property in &lt;STRONG&gt;ExtractText&lt;/STRONG&gt; processor&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;val&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(\d+)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;Then use &lt;STRONG&gt;ReplaceText&lt;/STRONG&gt; processor with below configs:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="table-cell required"&gt;Search Value&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="slick-cell l1 r1 pointer"&gt;&lt;DIV class="table-cell value required"&gt;&lt;PRE&gt;}&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="ui-widget-content slick-row odd active"&gt;&lt;SPAN class="table-cell required"&gt;Replacement Value&lt;/SPAN&gt;&lt;DIV class="slick-cell l1 r1 pointer selected"&gt;&lt;DIV class="table-cell value required"&gt;&lt;PRE&gt;,"y":"${val}"}&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="ui-widget-content slick-row even"&gt;&lt;DIV class="slick-cell l0 r0"&gt;&lt;SPAN class="table-cell required"&gt;Character Set&lt;/SPAN&gt;&lt;DIV class="slick-cell l1 r1 pointer"&gt;&lt;DIV class="table-cell value required"&gt;&lt;PRE&gt;UTF-8&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="ui-widget-content slick-row odd"&gt;&lt;DIV class="slick-cell l0 r0"&gt;&lt;SPAN class="table-cell required"&gt;Maximum Buffer Size&lt;/SPAN&gt;&lt;DIV class="slick-cell l1 r1 pointer"&gt;&lt;DIV class="table-cell value required"&gt;&lt;PRE&gt;1 MB&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="ui-widget-content slick-row even"&gt;&lt;DIV class="slick-cell l0 r0"&gt;&lt;SPAN class="table-cell required"&gt;Replacement Strategy&lt;/SPAN&gt;&lt;DIV class="slick-cell l1 r1 pointer"&gt;&lt;DIV class="table-cell value required"&gt;&lt;PRE&gt;Literal Replace&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="ui-widget-content slick-row odd"&gt;&lt;DIV class="slick-cell l0 r0"&gt;&lt;SPAN class="table-cell required"&gt;Evaluation Mode&lt;/SPAN&gt;&lt;DIV class="slick-cell l1 r1 pointer"&gt;&lt;DIV class="table-cell value required"&gt;&lt;PRE&gt;Entire text&lt;/PRE&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;By using &lt;STRONG&gt;Replacetext&lt;/STRONG&gt; processor we are extracting the value and adding "y" key with the extracted value.&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Input data:&lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"x":"avc123.abc.com"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;Output:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{"x":"avc123.abc.com","y":"123"}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 03:15:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/269992#M207212</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-09-09T03:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI JSON event extraction only integers from string</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/270025#M207234</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/55311"&gt;@Shu_ashu&lt;/a&gt;&amp;nbsp; Thank you very much! You saved the day for me.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 12:51:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/270025#M207234</guid>
      <dc:creator>ANMAR</dc:creator>
      <dc:date>2019-09-09T12:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI JSON event extraction only integers from string</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/270030#M207239</link>
      <description>&lt;P&gt;How about when i have multiple fields such as {&lt;BR /&gt;"x":"avc123.abc.com",&lt;BR /&gt;"z":"24 - ny"&lt;BR /&gt;}&lt;BR /&gt;and I would like to only targer "x" value for "123" and the rest won't get affected such as "z"&lt;BR /&gt;so the expected output would be&amp;nbsp;{&lt;BR /&gt;"x":"avc123.abc.com",&lt;BR /&gt;"z":"24 - ny",&lt;BR /&gt;"y":"123"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Please note that the "y" value only targeted the "x" and the z shouldn't be picked up?&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 13:27:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/270030#M207239</guid>
      <dc:creator>ANMAR</dc:creator>
      <dc:date>2019-09-09T13:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI JSON event extraction only integers from string</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/270040#M207248</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/55311"&gt;@Shu_ashu&lt;/a&gt;&amp;nbsp; I will wait for your response my friend. Thanks!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 15:15:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/270040#M207248</guid>
      <dc:creator>ANMAR</dc:creator>
      <dc:date>2019-09-09T15:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: NIFI JSON event extraction only integers from string</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/270089#M207281</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/69313"&gt;@ANMAR&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try with this regex in &lt;STRONG&gt;ExtractText&lt;/STRONG&gt; processor.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(?:"x":.\w+?)(\d+)&lt;/LI-CODE&gt;&lt;P&gt;This regex will extract only the digit in "x" key and adds that value for "y" key in &lt;STRONG&gt;ReplaceText&lt;/STRONG&gt; processor.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 02:54:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-JSON-event-extraction-only-integers-from-string/m-p/270089#M207281</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-09-10T02:54:11Z</dc:date>
    </item>
  </channel>
</rss>

