Code Monkey home page Code Monkey logo

Comments (8)

okkez avatar okkez commented on May 27, 2024

Use multiline_start_regexp ad multiline_end_regexp for that purpose.
BTW, mysql slow query log can be saved in the mysql table, and how about fluent-plugin-sql's in_sql?

from fluent-plugin-concat.

fahimeh2010 avatar fahimeh2010 commented on May 27, 2024

Consider these two line of logs

# Time: 160820  0:16:23
# User@Host: foo @foo []  Id: 1358
# Schema: foo  Last_errno: 0  Killed: 0
# Query_time: 1.8986  Lock_time: 0.000037  Rows_sent: 0  Rows_examined: 1  Rows_affected: 0
# Bytes_sent: 52
use hodhod;
SET timestamp=14720;
UPDATE foo SET foo='foo'
WHERE  (id = '15');
# Time: 160825 10:16:02
# User@Host: foo @ foo []  Id: 12105
# Schema: foo  Last_errno: 0  Killed: 0
# Query_time: 1.8751  Lock_time: 0.000022  Rows_sent: 0  Rows_examined: 124594  Rows_affected: 9
# Bytes_sent: 11
SET timestamp=143962;
INSERT INTO foo (....)

what I must set in multiline_start_regexp and multiline_end_regexp?

Thanks a lot

from fluent-plugin-concat.

okkez avatar okkez commented on May 27, 2024

Maybe,

multiline_start_regexp /# Time:/
multiline_end_regexp /^(?!SET timestamp).+;?$/

from fluent-plugin-concat.

fahimeh2010 avatar fahimeh2010 commented on May 27, 2024

actually first log have 9 lines, each of these include (SET timestamp=14720;\nUPDATE foo SET foo='foo'\nWHERE (id = '15');) is one line of log. the last line is WHERE (id = '15');

second log have 7 lines. the last line is INSERT INTO foo (....);

from fluent-plugin-concat.

okkez avatar okkez commented on May 27, 2024

Could you describe your full configuration?
I cannot imagine your situation at all.

from fluent-plugin-concat.

fahimeh2010 avatar fahimeh2010 commented on May 27, 2024
# Time: 160820  0:16:23
# User@Host: foo @foo []  Id: 1358
# Schema: foo  Last_errno: 0  Killed: 0
# Query_time: 1.8986  Lock_time: 0.000037  Rows_sent: 0  Rows_examined: 1  Rows_affected: 0
# Bytes_sent: 52
use hodhod;
SET timestamp=14720;
UPDATE foo SET foo='foo'
WHERE  (id = '15');

above log has 9 lines.

# Time: 160825 10:16:02
# User@Host: foo @ foo []  Id: 12105
# Schema: foo  Last_errno: 0  Killed: 0
# Query_time: 1.8751  Lock_time: 0.000022  Rows_sent: 0  Rows_examined: 124594  Rows_affected: 9
# Bytes_sent: 11
SET timestamp=143962;
INSERT INTO foo (....)

and this one has 7 lines.

now how can I write a proper configuration that include both of these 2 logs in cocat plugin?

Thanks a lot

from fluent-plugin-concat.

okkez avatar okkez commented on May 27, 2024

So what? Could you describe your full configuration? Nothing?

BTW, mysql slow query log can be saved in the mysql table, and how about fluent-plugin-sql's in_sql?

It is very difficult to write proper configuration without full configuration and all patterns of logs.

from fluent-plugin-concat.

okkez avatar okkez commented on May 27, 2024

No response.

from fluent-plugin-concat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.