<?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 filter logs according to terms using Apache Nifi? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-filter-logs-according-to-terms-using-Apache-Nifi/m-p/212318#M69611</link>
    <description>&lt;P&gt;Hi, thanks for the help. Then I understand that the scheme would be in: listensyslog &amp;gt; splittext &amp;gt; updatettribute &amp;gt; routeonatribute &amp;gt; putfile or putkafka&lt;/P&gt;</description>
    <pubDate>Fri, 13 Oct 2017 18:29:59 GMT</pubDate>
    <dc:creator>xavwebmaster</dc:creator>
    <dc:date>2017-10-13T18:29:59Z</dc:date>
    <item>
      <title>How to filter logs according to terms using Apache Nifi?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-filter-logs-according-to-terms-using-Apache-Nifi/m-p/212316#M69609</link>
      <description>&lt;P&gt;Hello everyone, &lt;/P&gt;&lt;P&gt;I'm receiving logs as input, these I separate using the processor splittext in line by line. &lt;/P&gt;&lt;P&gt;I am interested in being able to divert these according to a certain field to different destinations.&lt;/P&gt;&lt;P&gt;I am not sure how to generate these attributes or conditions in order to derive the log lines using the routeonattribute processor, or routeontext depending on what you recommend.&lt;/P&gt;&lt;P&gt;Example of entries: &lt;/P&gt;&lt;P&gt;1467, monday, texas, allow, smtp, mail,etc &lt;/P&gt;&lt;P&gt;1468, monday, texas, deny, smtp, mail,etc &lt;/P&gt;&lt;P&gt;Expected output: &lt;/P&gt;&lt;P&gt;To Putkafka (If the line of log contains the term' allow')&lt;/P&gt;&lt;P&gt;To Putfile (If the line of og contains the term' deny')&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 18:07:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-filter-logs-according-to-terms-using-Apache-Nifi/m-p/212316#M69609</guid>
      <dc:creator>xavwebmaster</dc:creator>
      <dc:date>2017-10-13T18:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter logs according to terms using Apache Nifi?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-filter-logs-according-to-terms-using-Apache-Nifi/m-p/212317#M69610</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/45374/xavwebmaster.html" nodeid="45374"&gt;@xav webmaster&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You need to generate flow file attributes based on the content of your data. These attrbutes will be used for routing in RouteOnAttribute. To construct these attributes you can use UpdateAttribute/ExtractText with Expression Langage. &lt;/P&gt;&lt;P&gt;If you just want to check if the line contains Allow or Deny you can use contains : &lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#contains" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#contains&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you want to verify a particular field then you need to parse the line. There are several methods to do it. For instance, you can use the function &lt;A href="https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html#getdelimitedfield"&gt;getDelimitedField&lt;/A&gt; since it's a CSV. Look also to record based processor. They have a ton of optimisation that can help you.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/articles/102183/record-based-processors-in-apache-nifi-12.html" target="_blank"&gt;https://community.hortonworks.com/articles/102183/record-based-processors-in-apache-nifi-12.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.apache.org/nifi/entry/record-oriented-data-with-nifi" target="_blank"&gt;https://blogs.apache.org/nifi/entry/record-oriented-data-with-nifi&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 18:13:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-filter-logs-according-to-terms-using-Apache-Nifi/m-p/212317#M69610</guid>
      <dc:creator>ahadjidj</dc:creator>
      <dc:date>2017-10-13T18:13:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter logs according to terms using Apache Nifi?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-filter-logs-according-to-terms-using-Apache-Nifi/m-p/212318#M69611</link>
      <description>&lt;P&gt;Hi, thanks for the help. Then I understand that the scheme would be in: listensyslog &amp;gt; splittext &amp;gt; updatettribute &amp;gt; routeonatribute &amp;gt; putfile or putkafka&lt;/P&gt;</description>
      <pubDate>Fri, 13 Oct 2017 18:29:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-filter-logs-according-to-terms-using-Apache-Nifi/m-p/212318#M69611</guid>
      <dc:creator>xavwebmaster</dc:creator>
      <dc:date>2017-10-13T18:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter logs according to terms using Apache Nifi?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-filter-logs-according-to-terms-using-Apache-Nifi/m-p/212319#M69612</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/45374/xavwebmaster.html" nodeid="45374" target="_blank"&gt;@xav webmaster&lt;/A&gt;&lt;P&gt;Can you test RouteOnContent with the property configured as follows :&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="40827-screen-shot-2017-10-13-at-20117-pm.png" style="width: 1924px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16584iA70D4840C64DC25C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="40827-screen-shot-2017-10-13-at-20117-pm.png" alt="40827-screen-shot-2017-10-13-at-20117-pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This routes flow files based on the fact that a line contains "Allow" or not. You will have two relations : Allow and unmatched&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 03:49:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-filter-logs-according-to-terms-using-Apache-Nifi/m-p/212319#M69612</guid>
      <dc:creator>ahadjidj</dc:creator>
      <dc:date>2019-08-18T03:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter logs according to terms using Apache Nifi?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-filter-logs-according-to-terms-using-Apache-Nifi/m-p/212320#M69613</link>
      <description>&lt;DIV&gt;It worked perfectly. Thanks!&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Oct 2017 19:45:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-filter-logs-according-to-terms-using-Apache-Nifi/m-p/212320#M69613</guid>
      <dc:creator>xavwebmaster</dc:creator>
      <dc:date>2017-10-13T19:45:51Z</dc:date>
    </item>
  </channel>
</rss>

