Fluentbit with mycat multiline parsing











up vote
0
down vote

favorite












I want make a log management system through EFK. I'm trying for days now to get my multiline mycat log parser to work with fluent-bit.



My fluentbit configuration:



parsers.conf:
[PARSER]
Name mycat_error_log_parser_head
Format regex
Regex ^(?<time>(d)+(-d+)+(S)+W(S)+)(s+)(?<action>S+)(s+)(?<on>S+)
Time_Key time
Time_Format %Y-%m-%d %H:%M:%S.%L
Time_Keep On

[PARSER]
Name mycat_error_log_parser
Format regex
Regex ^(?<time>(d)+(-d+)+(S)+W(S)+)(s+)(?<action>S+)(s+)(?<on>S+)(s+)(?<content>(.|s)*)$
Time_Key time
Time_Format %Y-%m-%d %H:%M:%S.%L
Time_Keep On

fluent-bit.conf
[INPUT]
Name tail
tag mycat
path /var/log/mycat.log
Multiline On
Parser_Firstline mycat_error_log_parser_head
Parser mycat_error_log_parser
Path_Key file


and the mycat.log looks like this:



mycat.log
2018-08-02 09:59:41.205 INFO [$_NIOConnector] (io.mycat.backend.datasource.PhysicalDatasource.getConnection(PhysicalDatasource.java:529)) - no ilde connection in pool,create new connection for hostS1 of schema mysql
2018-08-02 09:59:53.939 INFO [Timer0] (io.mycat.backend.datasource.PhysicalDatasource.getConnection(PhysicalDatasource.java:529)) - no ilde connection in pool,create new connection for hostS1 of schema mysql
2018-08-02 10:00:01.173 ERROR [$_NIOConnector] (io.mycat.net.NIOConnector.finishConnect(NIOConnector.java:155)) - error:
java.net.ConnectException: Connection timed out
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:1.7.0_111]
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744) ~[?:1.7.0_111]
at io.mycat.net.NIOConnector.finishConnect(NIOConnector.java:165) ~[Mycat-server-1.6.5-release.jar:?]
at io.mycat.net.NIOConnector.finishConnect(NIOConnector.java:143) ~[Mycat-server-1.6.5-release.jar:?]
at io.mycat.net.NIOConnector.run(NIOConnector.java:98) ~[Mycat-server-1.6.5-release.jar:?]
2018-08-02 10:00:01.173 INFO [$_NIOConnector] (io.mycat.net.AbstractConnection.close(AbstractConnection.java:514)) - close connection,reason:java.net.ConnectException: Connection timed out ,MySQLConnection [id=0, lastTime=1533175073937, user=root, schema=mysql, old shema=mysql, borrowed=false, fromSlaveDB=true, threadId=0, charset=utf8, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=parse1, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]
2018-08-02 10:00:01.173 INFO [$_NIOConnector] (io.mycat.sqlengine.SQLJob.connectionError(SQLJob.java:117)) - can't get connection for sql :select user()


I think about i'm close now, but no luck so far.



In my kibana. I get follow result:
enter image description here



My multi-line error log is missing. but i testing in rubular it normal parsing
enter image description here



Any help would be appreciated.










share|improve this question




























    up vote
    0
    down vote

    favorite












    I want make a log management system through EFK. I'm trying for days now to get my multiline mycat log parser to work with fluent-bit.



    My fluentbit configuration:



    parsers.conf:
    [PARSER]
    Name mycat_error_log_parser_head
    Format regex
    Regex ^(?<time>(d)+(-d+)+(S)+W(S)+)(s+)(?<action>S+)(s+)(?<on>S+)
    Time_Key time
    Time_Format %Y-%m-%d %H:%M:%S.%L
    Time_Keep On

    [PARSER]
    Name mycat_error_log_parser
    Format regex
    Regex ^(?<time>(d)+(-d+)+(S)+W(S)+)(s+)(?<action>S+)(s+)(?<on>S+)(s+)(?<content>(.|s)*)$
    Time_Key time
    Time_Format %Y-%m-%d %H:%M:%S.%L
    Time_Keep On

    fluent-bit.conf
    [INPUT]
    Name tail
    tag mycat
    path /var/log/mycat.log
    Multiline On
    Parser_Firstline mycat_error_log_parser_head
    Parser mycat_error_log_parser
    Path_Key file


    and the mycat.log looks like this:



    mycat.log
    2018-08-02 09:59:41.205 INFO [$_NIOConnector] (io.mycat.backend.datasource.PhysicalDatasource.getConnection(PhysicalDatasource.java:529)) - no ilde connection in pool,create new connection for hostS1 of schema mysql
    2018-08-02 09:59:53.939 INFO [Timer0] (io.mycat.backend.datasource.PhysicalDatasource.getConnection(PhysicalDatasource.java:529)) - no ilde connection in pool,create new connection for hostS1 of schema mysql
    2018-08-02 10:00:01.173 ERROR [$_NIOConnector] (io.mycat.net.NIOConnector.finishConnect(NIOConnector.java:155)) - error:
    java.net.ConnectException: Connection timed out
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:1.7.0_111]
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744) ~[?:1.7.0_111]
    at io.mycat.net.NIOConnector.finishConnect(NIOConnector.java:165) ~[Mycat-server-1.6.5-release.jar:?]
    at io.mycat.net.NIOConnector.finishConnect(NIOConnector.java:143) ~[Mycat-server-1.6.5-release.jar:?]
    at io.mycat.net.NIOConnector.run(NIOConnector.java:98) ~[Mycat-server-1.6.5-release.jar:?]
    2018-08-02 10:00:01.173 INFO [$_NIOConnector] (io.mycat.net.AbstractConnection.close(AbstractConnection.java:514)) - close connection,reason:java.net.ConnectException: Connection timed out ,MySQLConnection [id=0, lastTime=1533175073937, user=root, schema=mysql, old shema=mysql, borrowed=false, fromSlaveDB=true, threadId=0, charset=utf8, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=parse1, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]
    2018-08-02 10:00:01.173 INFO [$_NIOConnector] (io.mycat.sqlengine.SQLJob.connectionError(SQLJob.java:117)) - can't get connection for sql :select user()


    I think about i'm close now, but no luck so far.



    In my kibana. I get follow result:
    enter image description here



    My multi-line error log is missing. but i testing in rubular it normal parsing
    enter image description here



    Any help would be appreciated.










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I want make a log management system through EFK. I'm trying for days now to get my multiline mycat log parser to work with fluent-bit.



      My fluentbit configuration:



      parsers.conf:
      [PARSER]
      Name mycat_error_log_parser_head
      Format regex
      Regex ^(?<time>(d)+(-d+)+(S)+W(S)+)(s+)(?<action>S+)(s+)(?<on>S+)
      Time_Key time
      Time_Format %Y-%m-%d %H:%M:%S.%L
      Time_Keep On

      [PARSER]
      Name mycat_error_log_parser
      Format regex
      Regex ^(?<time>(d)+(-d+)+(S)+W(S)+)(s+)(?<action>S+)(s+)(?<on>S+)(s+)(?<content>(.|s)*)$
      Time_Key time
      Time_Format %Y-%m-%d %H:%M:%S.%L
      Time_Keep On

      fluent-bit.conf
      [INPUT]
      Name tail
      tag mycat
      path /var/log/mycat.log
      Multiline On
      Parser_Firstline mycat_error_log_parser_head
      Parser mycat_error_log_parser
      Path_Key file


      and the mycat.log looks like this:



      mycat.log
      2018-08-02 09:59:41.205 INFO [$_NIOConnector] (io.mycat.backend.datasource.PhysicalDatasource.getConnection(PhysicalDatasource.java:529)) - no ilde connection in pool,create new connection for hostS1 of schema mysql
      2018-08-02 09:59:53.939 INFO [Timer0] (io.mycat.backend.datasource.PhysicalDatasource.getConnection(PhysicalDatasource.java:529)) - no ilde connection in pool,create new connection for hostS1 of schema mysql
      2018-08-02 10:00:01.173 ERROR [$_NIOConnector] (io.mycat.net.NIOConnector.finishConnect(NIOConnector.java:155)) - error:
      java.net.ConnectException: Connection timed out
      at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:1.7.0_111]
      at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744) ~[?:1.7.0_111]
      at io.mycat.net.NIOConnector.finishConnect(NIOConnector.java:165) ~[Mycat-server-1.6.5-release.jar:?]
      at io.mycat.net.NIOConnector.finishConnect(NIOConnector.java:143) ~[Mycat-server-1.6.5-release.jar:?]
      at io.mycat.net.NIOConnector.run(NIOConnector.java:98) ~[Mycat-server-1.6.5-release.jar:?]
      2018-08-02 10:00:01.173 INFO [$_NIOConnector] (io.mycat.net.AbstractConnection.close(AbstractConnection.java:514)) - close connection,reason:java.net.ConnectException: Connection timed out ,MySQLConnection [id=0, lastTime=1533175073937, user=root, schema=mysql, old shema=mysql, borrowed=false, fromSlaveDB=true, threadId=0, charset=utf8, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=parse1, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]
      2018-08-02 10:00:01.173 INFO [$_NIOConnector] (io.mycat.sqlengine.SQLJob.connectionError(SQLJob.java:117)) - can't get connection for sql :select user()


      I think about i'm close now, but no luck so far.



      In my kibana. I get follow result:
      enter image description here



      My multi-line error log is missing. but i testing in rubular it normal parsing
      enter image description here



      Any help would be appreciated.










      share|improve this question















      I want make a log management system through EFK. I'm trying for days now to get my multiline mycat log parser to work with fluent-bit.



      My fluentbit configuration:



      parsers.conf:
      [PARSER]
      Name mycat_error_log_parser_head
      Format regex
      Regex ^(?<time>(d)+(-d+)+(S)+W(S)+)(s+)(?<action>S+)(s+)(?<on>S+)
      Time_Key time
      Time_Format %Y-%m-%d %H:%M:%S.%L
      Time_Keep On

      [PARSER]
      Name mycat_error_log_parser
      Format regex
      Regex ^(?<time>(d)+(-d+)+(S)+W(S)+)(s+)(?<action>S+)(s+)(?<on>S+)(s+)(?<content>(.|s)*)$
      Time_Key time
      Time_Format %Y-%m-%d %H:%M:%S.%L
      Time_Keep On

      fluent-bit.conf
      [INPUT]
      Name tail
      tag mycat
      path /var/log/mycat.log
      Multiline On
      Parser_Firstline mycat_error_log_parser_head
      Parser mycat_error_log_parser
      Path_Key file


      and the mycat.log looks like this:



      mycat.log
      2018-08-02 09:59:41.205 INFO [$_NIOConnector] (io.mycat.backend.datasource.PhysicalDatasource.getConnection(PhysicalDatasource.java:529)) - no ilde connection in pool,create new connection for hostS1 of schema mysql
      2018-08-02 09:59:53.939 INFO [Timer0] (io.mycat.backend.datasource.PhysicalDatasource.getConnection(PhysicalDatasource.java:529)) - no ilde connection in pool,create new connection for hostS1 of schema mysql
      2018-08-02 10:00:01.173 ERROR [$_NIOConnector] (io.mycat.net.NIOConnector.finishConnect(NIOConnector.java:155)) - error:
      java.net.ConnectException: Connection timed out
      at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[?:1.7.0_111]
      at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:744) ~[?:1.7.0_111]
      at io.mycat.net.NIOConnector.finishConnect(NIOConnector.java:165) ~[Mycat-server-1.6.5-release.jar:?]
      at io.mycat.net.NIOConnector.finishConnect(NIOConnector.java:143) ~[Mycat-server-1.6.5-release.jar:?]
      at io.mycat.net.NIOConnector.run(NIOConnector.java:98) ~[Mycat-server-1.6.5-release.jar:?]
      2018-08-02 10:00:01.173 INFO [$_NIOConnector] (io.mycat.net.AbstractConnection.close(AbstractConnection.java:514)) - close connection,reason:java.net.ConnectException: Connection timed out ,MySQLConnection [id=0, lastTime=1533175073937, user=root, schema=mysql, old shema=mysql, borrowed=false, fromSlaveDB=true, threadId=0, charset=utf8, txIsolation=3, autocommit=true, attachment=null, respHandler=null, host=parse1, port=3306, statusSync=null, writeQueue=0, modifiedSQLExecuted=false]
      2018-08-02 10:00:01.173 INFO [$_NIOConnector] (io.mycat.sqlengine.SQLJob.connectionError(SQLJob.java:117)) - can't get connection for sql :select user()


      I think about i'm close now, but no luck so far.



      In my kibana. I get follow result:
      enter image description here



      My multi-line error log is missing. but i testing in rubular it normal parsing
      enter image description here



      Any help would be appreciated.







      parsing elasticsearch fluentd






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 25 at 11:20









      Nicholas K

      4,67241029




      4,67241029










      asked Aug 2 at 4:02









      dream

      12




      12





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51645296%2ffluentbit-with-mycat-multiline-parsing%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51645296%2ffluentbit-with-mycat-multiline-parsing%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Sphinx de Gizeh

          Dijon

          Équipe cycliste