本文參考:/tupian/20230521/9436373.html? ? ? ? ? ? ? ?/tupian/20230521/10360264.html -ivh? logstash-6.6.2.rpm
成都創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比撫順網(wǎng)站開(kāi)發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式撫順網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋撫順地區(qū)。費(fèi)用合理售后完善,10多年實(shí)體公司更值得信賴。2.上傳數(shù)據(jù)庫(kù)驅(qū)動(dòng)jar包
wget? https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.48.tar.gz
mkdir?-p?/usr/share/logstash/vendor/jar/jdbc cd?/usr/share/logstash/vendor/jar/jdbc [root@localhost?soft]#?cd?/usr/share/logstash/vendor/jar/jdbc [root@localhost?jdbc]#?ll total?984 -rw-r--r--.?1?logstash?logstash?1006959?Jul?11?19:43?mysql-connector-java-5.1.48-bin.jar [root@localhost?jdbc]#
3.數(shù)據(jù)庫(kù)創(chuàng)建庫(kù) 并授權(quán)用戶
create?database?nginxlog; use?nginxlog; CREATE?TABLE?`consumerlog`?( ??`client_ip`?varchar(128)?DEFAULT?NULL, ??`log_time`?timestamp?NOT?NULL?DEFAULT?CURRENT_TIMESTAMP, ??`status`?int(6)?DEFAULT?NULL, ??`http_referer`?text, ??`AgentVersion`?varchar(512)?DEFAULT?NULL, )? grant?all??on??nginxlog.*?to??nginxlog@'%'??identified??by??'123456';
4.安裝?logstash-output-jdbc插件
vim?/usr/share/logstash/Gemfile #?source?"/tupian/20230521/rubygems.org"??將國(guó)外的源注釋,換成國(guó)內(nèi)的 source?"https://gems.ruby-china.com/"