Socket
Book a DemoInstallSign in
Socket

fluent-plugin-mysqlslowquerylog

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fluent-plugin-mysqlslowquerylog

bundlerRubygems
Version
0.0.3
Version published
Maintainers
1
Created
Source

fluent-plugin-mysqlslowquerylog, a plugin for Fluentd

Component

MySQL Slow Query Log Output

Fluentd plugin to concat MySQL slowquerylog.

Configuration

Input Messages (Slow Query Log)

# Time: 130107 11:36:21
# User@Host: root[root] @ localhost []
# Query_time: 0.000378  Lock_time: 0.000111 Rows_sent: 7  Rows_examined: 7
SET timestamp=1357526181;
select * from user;
# Time: 130107 11:38:47
# User@Host: root[root] @ localhost []
# Query_time: 0.002142  Lock_time: 0.000166 Rows_sent: 142  Rows_examined: 142
use information_schema;
SET timestamp=1357526327;
select * from INNODB_BUFFER_PAGE_LRU;

Output Messages

2013-01-07T11:36:21+09:00    cocatenated.mysql.slowlog	{"user":"root[root]","host":"localhost","query_time":0.000378,"lock_time":0.000111,"rows_sent":7,"rows_examined":7,"sql":"SET timestamp=1357526181; select * from user;"}
2013-01-07T11:38:47+09:00	cocatenated.mysql.slowlog	{"user":"root[root]","host":"localhost","query_time":0.002142,"lock_time":0.000166,"rows_sent":142,"rows_examined":142,"sql":"use information_schema; SET timestamp=1357526327; select * from INNODB_BUFFER_PAGE_LRU;"}

Example Settings

sender (fluent-agent-lite)

TAG_PREFIX="mysql"
LOGS=$(cat <<"EOF"
slowlog.db01 /var/log/mysql/mysql-slow.log
EOF
)
PRIMARY_SERVER="log_server:24224"

sender (td-agent)

<source>
  type tail
  path   /var/log/mysql/mysql-slow.log
  format /^(?<message>.+)$/
  tag    mysql.slowlog.db01
</source>
<match>
  type forward
  host log_server
</match>

reciever

<source>
  type forward
</source>
<match mysql.slowlog.*>
  type mysqlslowquerylog
  add_tag_prefix cocatenated.
</match>
<match cocatenated.mysql.slowlog.*>
  type file
  path /tmp/slowtest
</match>

Installation

Add this line to your application's Gemfile:

gem 'fluent-plugin-mysqlslowquerylog'

And then execute:

$ bundle

Or install it yourself as:

$ gem install fluent-plugin-mysqlslowquerylog

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

Copyright (c) 2012- Satoshi SUZUKI (@studio3104)

License

Apache License, Version 2.0

FAQs

Package last updated on 25 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.