
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
fluent-plugin-mysql-bulk
Advanced tools
fluent plugin mysql bulk insert is high performance and on duplicate key update respond.
/usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-mysql-bulk
sudo /usr/local/Cellar/td-agent/1.1.XX/bin/fluent-gem install fluent-plugin-mysql-bulk
gem install fluent-plugin-mysql-bulk
param | value |
---|---|
host | database host(default: 127.0.0.1) |
database | database name(require) |
username | user(require) |
password | password(default: blank) |
column_names | bulk insert column (require) |
key_names | value key names, ${time} is placeholder Time.at(time).strftime("%Y-%m-%d %H:%M:%S") (default : column_names) |
table | bulk insert table (require) |
on_duplicate_key_update | on duplicate key update enable (true:false) |
on_duplicate_update_keys | on duplicate key update column, comma separator |
<match mysql.input>
type mysql_bulk
host localhost
database test_app_development
username root
password hogehoge
column_names id,user_name,created_at,updated_at
table users
flush_interval 10s
</match>
Assume following input is coming:
mysql.input: {"user_name":"toyama","created_at":"2014/01/03 21:35:15","updated_at":"2014/01/03 21:35:15","dummy":"hogehoge"}
mysql.input: {"user_name":"toyama2","created_at":"2014/01/03 21:35:21","updated_at":"2014/01/03 21:35:21","dummy":"hogehoge"}
mysql.input: {"user_name":"toyama3","created_at":"2014/01/03 21:35:27","updated_at":"2014/01/03 21:35:27","dummy":"hogehoge"}
then result becomes as below (indented):
+-----+-----------+---------------------+---------------------+
| id | user_name | created_at | updated_at |
+-----+-----------+---------------------+---------------------+
| 1 | toyama | 2014-01-03 21:35:15 | 2014-01-03 21:35:15 |
| 2 | toyama2 | 2014-01-03 21:35:21 | 2014-01-03 21:35:21 |
| 3 | toyama3 | 2014-01-03 21:35:27 | 2014-01-03 21:35:27 |
+-----+-----------+---------------------+---------------------+
running query
INSERT INTO users (id,user_name,created_at,updated_at) VALUES (NULL,'toyama','2014/01/03 21:35:15','2014/01/03 21:35:15'),(NULL,'toyama2','2014/01/03 21:35:21','2014/01/03 21:35:21')
<match mysql.input>
type mysql_bulk
host localhost
database test_app_development
username root
password hogehoge
column_names id,user_name,created_at,updated_at
table users
on_duplicate_key_update true
on_duplicate_update_keys user_name,updated_at
flush_interval 60s
</match>
Assume following input is coming:
mysql.input: {"id":"1" ,"user_name":"toyama7","created_at":"2014/01/03 21:58:03","updated_at":"2014/01/03 21:58:03"}
mysql.input: {"id":"2" ,"user_name":"toyama7","created_at":"2014/01/03 21:58:06","updated_at":"2014/01/03 21:58:06"}
mysql.input: {"id":"3" ,"user_name":"toyama7","created_at":"2014/01/03 21:58:08","updated_at":"2014/01/03 21:58:08"}
mysql.input: {"id":"10","user_name":"toyama7","created_at":"2014/01/03 21:58:18","updated_at":"2014/01/03 21:58:18"}
then result becomes as below (indented):
+-----+-----------+---------------------+---------------------+
| id | user_name | created_at | updated_at |
+-----+-----------+---------------------+---------------------+
| 1 | toyama7 | 2014-01-03 21:35:15 | 2014-01-03 21:58:03 |
| 2 | toyama7 | 2014-01-03 21:35:21 | 2014-01-03 21:58:06 |
| 3 | toyama7 | 2014-01-03 21:35:27 | 2014-01-03 21:58:08 |
| 10 | toyama7 | 2014-01-03 21:58:18 | 2014-01-03 21:58:18 |
+-----+-----------+---------------------+---------------------+
if duplicate id , update username and updated_at
<match mysql.input>
type mysql_bulk
host localhost
database test_app_development
username root
password hogehoge
column_names id,user_name,created_at,updated_at
key_names id,user,created_date,updated_date
table users
flush_interval 10s
</match>
Assume following input is coming:
mysql.input: {"user":"toyama","created_date":"2014/01/03 21:35:15","updated_date":"2014/01/03 21:35:15","dummy":"hogehoge"}
mysql.input: {"user":"toyama2","created_date":"2014/01/03 21:35:21","updated_date":"2014/01/03 21:35:21","dummy":"hogehoge"}
mysql.input: {"user":"toyama3","created_date":"2014/01/03 21:35:27","updated_date":"2014/01/03 21:35:27","dummy":"hogehoge"}
then result becomes as below (indented):
+-----+-----------+---------------------+---------------------+
| id | user_name | created_at | updated_at |
+-----+-----------+---------------------+---------------------+
| 1 | toyama | 2014-01-03 21:35:15 | 2014-01-03 21:35:15 |
| 2 | toyama2 | 2014-01-03 21:35:21 | 2014-01-03 21:35:21 |
| 3 | toyama3 | 2014-01-03 21:35:27 | 2014-01-03 21:35:27 |
+-----+-----------+---------------------+---------------------+
bundle install
rake test
divide bulk insert(exsample 1000 per)
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)Copyright (c) 2013 Hiroshi Toyama. See LICENSE for details.
FAQs
Unknown package
We found that fluent-plugin-mysql-bulk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.