简体   繁体   English

Logstash INPUT MySQL

[英]Logstash INPUT MySQL

Can't find any input plugin for Relational Databases in Logstash Documentation. 在Logstash文档中找不到关系数据库的任何输入插件。

What is the best approach to import data from one Relational Database Table with logstash? 使用logstash从一个关系数据库表导入数据的最佳方法是什么? Is to connect Elastic Search directly to the database using JDBC? 是使用JDBC将Elastic Search直接连接到数据库吗?

You'll need to use JDBC River ( https://github.com/jprante/elasticsearch-river-jdbc ) for loading JDBC data into elastic search (or write your own code to do it). 您需要使用JDBC River( https://github.com/jprante/elasticsearch-river-jdbc )将JDBC数据加载到弹性搜索中(或编写您自己的代码来执行此操作)。

It looks like there are several JIRAs open requesting JDBC loading in Logstash, but they haven't been worked: https://logstash.jira.com/browse/LOGSTASH-1764 看起来有几个JIRA在Logstash中开放请求JDBC加载,但是它们还没有工作: https ://logstash.jira.com/browse/LOGSTASH-1764

There's this 就是这个

WIP: Under Development, NOT FOR PRODUCTION WIP:正在开发中,不适用于生产

This is a plugin for Logstash. 这是Logstash的插件。

It is fully free and fully open source. 它完全免费且完全开源。 The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way. 许可证是Apache 2.0,这意味着您可以随意使用它,无论如何。

Logstash provides infrastructure to automatically generate documentation for this plugin. Logstash提供了自动生成此插件文档的基础结构。 We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. 我们使用asciidoc格式编写文档,因此源代码中的任何注释都将首先转换为asciidoc,然后转换为html。 All plugin documentation are placed under one central location. 所有插件文档都放在一个中心位置。

So far, there is no any Logstash API for reading SQL. 到目前为止,没有任何用于读取SQL的Logstash API。

For my recommendation, you can write a program/script such as JAVA/python to read the logs from sql database and write to a file. 根据我的建议,你可以编写一个程序/脚本,如JAVA / python,从sql数据库中读取日志并写入文件。 Then use logstash file API to read from the file. 然后使用logstash 文件 API从文件中读取。 The Logstash website has getting started tutorial. Logstash网站有入门教程。 It is easy to learn. 这很容易学习。
Good Luck 祝好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM