<?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>topic Re: Fetch and store result from log.info() into mysql database using talend studio in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Fetch-and-store-result-from-log-info-into-mysql-database-using/m-p/2295866#M68590</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can read and parse the logs produced by spark and use a tFileInputDelimited -&amp;gt; tFilterRow -&amp;gt; tDBOutput(MySQL)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another option would be to use the outputLine of tSystem if the job you call produces console logs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Log4j messages themselves could be forwarded to a database.  One would have to use JDBCAppender for log4j.&lt;/P&gt;&lt;P&gt;In case of Log4J2 the config I used (for a POC!) was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;lt;JDBC name="dbAppender" tableName="log4j2.all_log" connectionSource="PoolingDriver"&amp;gt;&lt;/P&gt;&lt;P&gt;		&amp;lt;DriverManager connectionString="jdbc:postgresql://localhost:5432/postgres"&amp;nbsp;&lt;/P&gt;&lt;P&gt;				driverClassName="org.postgresql.Driver" username="postgres" password=":)"&amp;nbsp;/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Column name="moment" isEventTimestamp="true" /&amp;gt;&lt;/P&gt;&lt;P&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Column name="origin"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;isUnicode="false" pattern="%replace{%msg}{(.+) - (.*)}{$1}" /&amp;gt;&lt;/P&gt;&lt;P&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Column name="message" isUnicode="false" pattern="%replace{%msg}{(.+) - (.*)}{$2}" /&amp;gt;&lt;/P&gt;&lt;P&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Column name="mdc" isUnicode="false" pattern="%X" /&amp;gt;&lt;/P&gt;&lt;P&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Column name="level" isUnicode="false" pattern="%level" /&amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;Filters&amp;gt;&lt;/P&gt;&lt;P&gt;				&amp;lt;MapFilter onMatch="NEUTRAL" onMismatch="ACCEPT"&amp;gt;&lt;/P&gt;&lt;P&gt;					&amp;lt;KeyValuePair key="_pid" value="0"/&amp;gt;&lt;/P&gt;&lt;P&gt;				&amp;lt;/MapFilter&amp;gt;&lt;/P&gt;&lt;P&gt;				&amp;lt;RegexFilter regex="^(connectionStatsLogs|talendStats_|talendMeter_|talendLogs_|tLogRow_).+" onMatch="DENY" onMismatch="ACCEPT"/&amp;gt;&lt;/P&gt;&lt;P&gt;				&amp;lt;RegexFilter regex=".+ - Parameters:.+" onMatch="DENY" onMismatch="ACCEPT"/&amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;/Filters&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/JDBC&amp;gt;&lt;/P&gt;&lt;P&gt;This config is not for production use as it creates a lot of new connections.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Apr 2022 08:54:13 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-04-08T08:54:13Z</dc:date>
    <item>
      <title>Fetch and store result from log.info() into mysql database using talend studio</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Fetch-and-store-result-from-log-info-into-mysql-database-using/m-p/2295865#M68589</link>
      <description>&lt;P&gt;Currently, my spark job managed to output result from the &lt;A href="https://log.info" alt="https://log.info" target="_blank"&gt;log.info&lt;/A&gt;() function. What I was trying to do now is to fetch and store the output into a proper mysql database using talend component.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Result from spark:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;INFO:spark2:Source rows = 2692687&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;INFO:jspark2:Destination rows = 2692687&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My idea is to use these workflow to achieve the task objective:&lt;/P&gt;&lt;P&gt;tSystem (submit spark job) &amp;gt;&amp;gt; tFileInputDelimited (fetch the printing result from spark) &amp;gt;&amp;gt; &amp;lt;some mysql component to store result to msql&amp;gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to do this way?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2024 23:02:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Fetch-and-store-result-from-log-info-into-mysql-database-using/m-p/2295865#M68589</guid>
      <dc:creator>WSyahirah21</dc:creator>
      <dc:date>2024-11-15T23:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch and store result from log.info() into mysql database using talend studio</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Fetch-and-store-result-from-log-info-into-mysql-database-using/m-p/2295866#M68590</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can read and parse the logs produced by spark and use a tFileInputDelimited -&amp;gt; tFilterRow -&amp;gt; tDBOutput(MySQL)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another option would be to use the outputLine of tSystem if the job you call produces console logs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Log4j messages themselves could be forwarded to a database.  One would have to use JDBCAppender for log4j.&lt;/P&gt;&lt;P&gt;In case of Log4J2 the config I used (for a POC!) was:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;lt;JDBC name="dbAppender" tableName="log4j2.all_log" connectionSource="PoolingDriver"&amp;gt;&lt;/P&gt;&lt;P&gt;		&amp;lt;DriverManager connectionString="jdbc:postgresql://localhost:5432/postgres"&amp;nbsp;&lt;/P&gt;&lt;P&gt;				driverClassName="org.postgresql.Driver" username="postgres" password=":)"&amp;nbsp;/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Column name="moment" isEventTimestamp="true" /&amp;gt;&lt;/P&gt;&lt;P&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Column name="origin"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;isUnicode="false" pattern="%replace{%msg}{(.+) - (.*)}{$1}" /&amp;gt;&lt;/P&gt;&lt;P&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Column name="message" isUnicode="false" pattern="%replace{%msg}{(.+) - (.*)}{$2}" /&amp;gt;&lt;/P&gt;&lt;P&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Column name="mdc" isUnicode="false" pattern="%X" /&amp;gt;&lt;/P&gt;&lt;P&gt;	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;Column name="level" isUnicode="false" pattern="%level" /&amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;Filters&amp;gt;&lt;/P&gt;&lt;P&gt;				&amp;lt;MapFilter onMatch="NEUTRAL" onMismatch="ACCEPT"&amp;gt;&lt;/P&gt;&lt;P&gt;					&amp;lt;KeyValuePair key="_pid" value="0"/&amp;gt;&lt;/P&gt;&lt;P&gt;				&amp;lt;/MapFilter&amp;gt;&lt;/P&gt;&lt;P&gt;				&amp;lt;RegexFilter regex="^(connectionStatsLogs|talendStats_|talendMeter_|talendLogs_|tLogRow_).+" onMatch="DENY" onMismatch="ACCEPT"/&amp;gt;&lt;/P&gt;&lt;P&gt;				&amp;lt;RegexFilter regex=".+ - Parameters:.+" onMatch="DENY" onMismatch="ACCEPT"/&amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;/Filters&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/JDBC&amp;gt;&lt;/P&gt;&lt;P&gt;This config is not for production use as it creates a lot of new connections.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 08:54:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Fetch-and-store-result-from-log-info-into-mysql-database-using/m-p/2295866#M68590</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-04-08T08:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: Fetch and store result from log.info() into mysql database using talend studio</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Fetch-and-store-result-from-log-info-into-mysql-database-using/m-p/2295867#M68591</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;currently I found other alternative to fetch the string output using:&lt;/P&gt;&lt;P&gt;tSystem_1 (print the output) -&amp;gt; tJava (get the output and bring to next component)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tSystem_1 output:&lt;/P&gt;&lt;P&gt;&lt;B&gt;('source count:', '1000')&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;('destination count:', '100')&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tJava code:&lt;/P&gt;&lt;P&gt;String output=((String)globalMap.get("tSystem_1_OUTPUT"));&lt;/P&gt;&lt;P&gt;System.out.println("Printing the error code 1 : "+StringUtils.substringBetween(output,"source count:", "destination count:"));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tJava output:&lt;/P&gt;&lt;P&gt;&lt;B&gt;Printing the error code 1 : ', '1000')&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;('&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, tJava takes the result exactly between string " &lt;B&gt;source count:' &lt;/B&gt;" and " &lt;B&gt;destination count:&lt;/B&gt; ", so that included the bracket and all. The expected result is only to get the value &lt;B&gt;1000. &lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I apply this java code to fetch the correct output?&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2022 08:43:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Fetch-and-store-result-from-log-info-into-mysql-database-using/m-p/2295867#M68591</guid>
      <dc:creator>WSyahirah21</dc:creator>
      <dc:date>2022-04-09T08:43:05Z</dc:date>
    </item>
  </channel>
</rss>

