Commit af9a3f22 by Administrator

update

parent 9b53ec54
input {
stdin {
}
jdbc {
type => "album"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_album?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_album.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => index_time
record_last_run => true
last_run_metadata_path => "./station_album.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
}
filter {
ruby {
code => "event.timestamp.time.localtime"
}
}
output {
if [type] == "album" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "album"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "album" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "doc_recommend"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{recommendId}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
stdout {
codec => json_lines
}
}
input {
stdin {
}
# caseLibrary start -----------------------------------------------------------------------------------------------------
jdbc {
type => "case_library"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_case_library?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_caseLibrary.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => update_time
record_last_run => true
last_run_metadata_path => "./station_caseLibrary.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
jdbc {
type => "case_library_auth"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_case_library?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_caseLibrary_relationIds.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => update_time
record_last_run => true
last_run_metadata_path => "./station_caseLibrary_relationIds.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
# caseLibrary end -----------------------------------------------------------------------------------------------------
# studentCase start -----------------------------------------------------------------------------------------------------
jdbc {
type => "student_case"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_case_library?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_studentCase.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => update_time
record_last_run => true
last_run_metadata_path => "./station_studentCase.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
jdbc {
type => "student_case_auth"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_case_library?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_studentCase_relationIds.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => update_time
record_last_run => true
last_run_metadata_path => "./station_studentCase_relationIds.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
# studentCase end -----------------------------------------------------------------------------------------------------
}
filter {
ruby {
code => "event.timestamp.time.localtime"
}
}
output {
if [type] == "student_case" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "student_case"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "student_case_auth" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "student_case_auth"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "student_case" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "doc_recommend"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{recommendId}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "case_library" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "case_library"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "case_library_auth" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "case_library_auth"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "case_library" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "doc_recommend"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{recommendId}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
stdout {
codec => json_lines
}
}
input {
stdin {
}
# course start -----------------------------------------------------------------------------------------------------
# 课程
jdbc {
type => "course"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_course?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_course.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => index_time
record_last_run => true
last_run_metadata_path => "./station_course.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
# 课程
jdbc {
type => "course_auth"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_course?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_course_relationIds.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => index_time
record_last_run => true
last_run_metadata_path => "./station_course_relationIds.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
# course end -----------------------------------------------------------------------------------------------------
# offlineCourse start -----------------------------------------------------------------------------------------------------
jdbc {
type => "offline_course"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_course?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_offlineCourse.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => index_time
record_last_run => true
last_run_metadata_path => "./station_offlineCourse.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
# offlineCourse end -----------------------------------------------------------------------------------------------------
}
filter {
ruby {
code => "event.timestamp.time.localtime"
}
}
output {
if [type] == "course" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "course"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "course_auth" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "course_auth"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "course" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "doc_recommend"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{recommendId}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "offline_course" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "offline_course"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
stdout {
codec => json_lines
}
}
input {
stdin {
}
# exam start -----------------------------------------------------------------------------------------------------
jdbc {
type => "exam"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_exam?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_exam.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => index_time
record_last_run => true
last_run_metadata_path => "./station_exam.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
jdbc {
type => "exam_auth"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_exam?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_exam_relationIds.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => index_time
record_last_run => true
last_run_metadata_path => "./station_exam_relationIds.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
# exam end -----------------------------------------------------------------------------------------------------
}
filter {
ruby {
code => "event.timestamp.time.localtime"
}
}
output {
if [type] == "exam" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "exam"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "exam_auth" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "exam_auth"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "exam" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "doc_recommend"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{recommendId}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
stdout {
codec => json_lines
}
}
input {
stdin {
}
# lecturer start -----------------------------------------------------------------------------------------------------
# 物理删除,暂时无法做到近实时同步
jdbc {
type => "lecturer"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_lecturer?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_lecturer.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => index_time
record_last_run => true
last_run_metadata_path => "./station_lecturer.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
# lecturer end -----------------------------------------------------------------------------------------------------
}
filter {
ruby {
code => "event.timestamp.time.localtime"
}
}
output {
if [type] == "lecturer" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "lecturer"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
stdout {
codec => json_lines
}
}
input {
stdin {
}
# live start -----------------------------------------------------------------------------------------------------
jdbc {
type => "live"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_live?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_live.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => update_time
record_last_run => true
last_run_metadata_path => "./station_live.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
# live end -----------------------------------------------------------------------------------------------------
}
filter {
ruby {
code => "event.timestamp.time.localtime"
}
}
output {
if [type] == "live" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "live"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "live_auth" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "live_auth"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "live" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "doc_recommend"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{recommendId}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
stdout {
codec => json_lines
}
}
input {
stdin {
}
# research start -----------------------------------------------------------------------------------------------------
jdbc {
type => "research"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_research?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_research.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => index_time
record_last_run => true
last_run_metadata_path => "./station_research.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
jdbc {
type => "research_auth"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_research?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_research_relationIds.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => index_time
record_last_run => true
last_run_metadata_path => "./station_research_relationIds.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
# research end -----------------------------------------------------------------------------------------------------
}
filter {
ruby {
code => "event.timestamp.time.localtime"
}
}
output {
if [type] == "research" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "research"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "research_auth" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "research_auth"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "research" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "doc_recommend"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{recommendId}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
stdout {
codec => json_lines
}
}
input {
stdin {
}
jdbc {
type => "account"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_system?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_account.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => index_time
record_last_run => true
last_run_metadata_path => "./station_account.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
jdbc {
type => "organization"
# 数据库
jdbc_connection_string => "jdbc:mysql://192.168.10.32:3306/cloud_system?tinyInt1isBit=false"
jdbc_user => "fulandba"
jdbc_password => "Fldba#13!"
jdbc_driver_library => "/opt/logstash-7.6.2/logstash-config/mysql-connector-java-5.1.25.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
codec => plain { charset => "UTF-8"}
lowercase_column_names => false
statement_filepath => "/opt/logstash-7.6.2/logstash-config/sql/query_organization.sql"
jdbc_paging_enabled => "true"
jdbc_page_size => "5000"
# 不使用字段值追踪,直接用该次更新的当前时间赋值到:sql_last_value,然后在sql中用创建时间和更新时间 >= :sql_last_value
use_column_value => false
tracking_column => index_time
record_last_run => true
last_run_metadata_path => "./station_organization.txt"
# 设置监听间隔 各字段含义(由左至右)分、时、天、月、年,全部为*默认含义为每分钟都更新
schedule => "* * * * *"
}
}
filter {
ruby {
code => "event.timestamp.time.localtime"
}
}
output {
if [type] == "organization" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "organization"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
if [type] == "account" {
elasticsearch {
hosts => "elasticsearch7:9200"
# index名
index => "account"
# 需要关联的数据库中有有一个id字段,对应索引的id号
document_id => "%{id}"
template_overwrite => true
template => "/opt/logstash-7.6.2/logstash-config/template/logstash.json"
}
}
stdout {
codec => json_lines
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment