代码拉取完成,页面将自动刷新
input {
stdin {}
jdbc {
type => "blog"
# 数据库连接地址
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/hospitalsys?serverTimezone=GMT&characterEncoding=UTF-8&useSSL=false"
# 数据库连接账号密码;
jdbc_user => "root"
jdbc_password => "HRX200138"
# MySQL依赖包路径;
jdbc_driver_library => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\mysql-connector-java-8.0.11.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
# 数据库重连尝试次数
connection_retry_attempts => "3"
# 判断数据库连接是否可用,默认false不开启
jdbc_validate_connection => "true"
# 数据库连接可用校验超时时间,默认3600S
jdbc_validation_timeout => "3600"
# 开启分页查询(默认false不开启);
jdbc_paging_enabled => "true"
# 单次分页查询条数(默认100000,若字段较多且更新频率较高,建议调低此值);
jdbc_page_size => "5000"
# statement为查询数据sql,如果sql较复杂,建议配通过statement_filepath配置sql文件的存放路径;
# sql_last_value为内置的变量,存放上次查询结果中最后一条数据tracking_column的值,此处即为ModifyTime;
# statement_filepath => "mysql/jdbc.sql"
statement => "SELECT * FROM `news_news_blog`"
# 是否将字段名转换为小写,默认true(如果有数据序列化、反序列化需求,建议改为false);
lowercase_column_names => false
# Value can be any of: fatal,error,warn,info,debug,默认info;
sql_log_level => warn
#
# 是否记录上次执行结果,true表示会将上次执行结果的tracking_column字段的值保存到last_run_metadata_path指定的文件中;
record_last_run => true
# 需要记录查询结果某字段的值时,此字段为true,否则默认tracking_column为timestamp的值;
use_column_value => true
# 需要记录的字段,用于增量同步,需是数据库字段
tracking_column => "create_time"
# Value can be any of: numeric,timestamp,Default value is "numeric"
tracking_column_type => timestamp
# record_last_run上次数据存放位置;
last_run_metadata_path => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\last_id.txt"
# 是否清除last_run_metadata_path的记录,需要增量同步时此字段必须为false;
clean_run => false
#
# 同步频率(分 时 天 月 年),默认每分钟同步一次;
schedule => "* * * * *"
}
jdbc {
type => "category"
# 数据库连接地址
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/hospitalsys?serverTimezone=GMT&characterEncoding=UTF-8&useSSL=false"
# 数据库连接账号密码;
jdbc_user => "root"
jdbc_password => "HRX200138"
# MySQL依赖包路径;
jdbc_driver_library => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\mysql-connector-java-8.0.11.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
# 数据库重连尝试次数
connection_retry_attempts => "3"
# 判断数据库连接是否可用,默认false不开启
jdbc_validate_connection => "true"
# 数据库连接可用校验超时时间,默认3600S
jdbc_validation_timeout => "3600"
# 开启分页查询(默认false不开启);
jdbc_paging_enabled => "true"
# 单次分页查询条数(默认100000,若字段较多且更新频率较高,建议调低此值);
jdbc_page_size => "5000"
# statement为查询数据sql,如果sql较复杂,建议配通过statement_filepath配置sql文件的存放路径;
# sql_last_value为内置的变量,存放上次查询结果中最后一条数据tracking_column的值,此处即为ModifyTime;
# statement_filepath => "mysql/jdbc.sql"
statement => "SELECT * FROM `news_news_category`"
# 是否将字段名转换为小写,默认true(如果有数据序列化、反序列化需求,建议改为false);
lowercase_column_names => false
# Value can be any of: fatal,error,warn,info,debug,默认info;
sql_log_level => warn
#
# 是否记录上次执行结果,true表示会将上次执行结果的tracking_column字段的值保存到last_run_metadata_path指定的文件中;
record_last_run => true
# 需要记录查询结果某字段的值时,此字段为true,否则默认tracking_column为timestamp的值;
use_column_value => true
# 需要记录的字段,用于增量同步,需是数据库字段
tracking_column => "id"
# Value can be any of: numeric,timestamp,Default value is "numeric"
tracking_column_type => timestamp
# record_last_run上次数据存放位置;
last_run_metadata_path => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\last_id.txt"
# 是否清除last_run_metadata_path的记录,需要增量同步时此字段必须为false;
clean_run => false
#
# 同步频率(分 时 天 月 年),默认每分钟同步一次;
schedule => "* * * * *"
}
jdbc {
type => "tag"
# 数据库连接地址
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/hospitalsys?serverTimezone=GMT&characterEncoding=UTF-8&useSSL=false"
# 数据库连接账号密码;
jdbc_user => "root"
jdbc_password => "HRX200138"
# MySQL依赖包路径;
jdbc_driver_library => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\mysql-connector-java-8.0.11.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
# 数据库重连尝试次数
connection_retry_attempts => "3"
# 判断数据库连接是否可用,默认false不开启
jdbc_validate_connection => "true"
# 数据库连接可用校验超时时间,默认3600S
jdbc_validation_timeout => "3600"
# 开启分页查询(默认false不开启);
jdbc_paging_enabled => "true"
# 单次分页查询条数(默认100000,若字段较多且更新频率较高,建议调低此值);
jdbc_page_size => "5000"
# statement为查询数据sql,如果sql较复杂,建议配通过statement_filepath配置sql文件的存放路径;
# sql_last_value为内置的变量,存放上次查询结果中最后一条数据tracking_column的值,此处即为ModifyTime;
# statement_filepath => "mysql/jdbc.sql"
statement => "SELECT * FROM `news_news_tag`"
# 是否将字段名转换为小写,默认true(如果有数据序列化、反序列化需求,建议改为false);
lowercase_column_names => false
# Value can be any of: fatal,error,warn,info,debug,默认info;
sql_log_level => warn
#
# 是否记录上次执行结果,true表示会将上次执行结果的tracking_column字段的值保存到last_run_metadata_path指定的文件中;
record_last_run => true
# 需要记录查询结果某字段的值时,此字段为true,否则默认tracking_column为timestamp的值;
use_column_value => true
# 需要记录的字段,用于增量同步,需是数据库字段
tracking_column => "id"
# Value can be any of: numeric,timestamp,Default value is "numeric"
tracking_column_type => timestamp
# record_last_run上次数据存放位置;
last_run_metadata_path => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\last_id.txt"
# 是否清除last_run_metadata_path的记录,需要增量同步时此字段必须为false;
clean_run => false
#
# 同步频率(分 时 天 月 年),默认每分钟同步一次;
schedule => "* * * * *"
}
jdbc {
type => "drug_category"
# 数据库连接地址
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/hospitalsys?serverTimezone=GMT&characterEncoding=UTF-8&useSSL=false"
# 数据库连接账号密码;
jdbc_user => "root"
jdbc_password => "HRX200138"
# MySQL依赖包路径;
jdbc_driver_library => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\mysql-connector-java-8.0.11.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
# 数据库重连尝试次数
connection_retry_attempts => "3"
# 判断数据库连接是否可用,默认false不开启
jdbc_validate_connection => "true"
# 数据库连接可用校验超时时间,默认3600S
jdbc_validation_timeout => "3600"
# 开启分页查询(默认false不开启);
jdbc_paging_enabled => "true"
# 单次分页查询条数(默认100000,若字段较多且更新频率较高,建议调低此值);
jdbc_page_size => "5000"
# statement为查询数据sql,如果sql较复杂,建议配通过statement_filepath配置sql文件的存放路径;
# sql_last_value为内置的变量,存放上次查询结果中最后一条数据tracking_column的值,此处即为ModifyTime;
# statement_filepath => "mysql/jdbc.sql"
statement => "SELECT * FROM `drug_drug_category`"
# 是否将字段名转换为小写,默认true(如果有数据序列化、反序列化需求,建议改为false);
lowercase_column_names => false
# Value can be any of: fatal,error,warn,info,debug,默认info;
sql_log_level => warn
#
# 是否记录上次执行结果,true表示会将上次执行结果的tracking_column字段的值保存到last_run_metadata_path指定的文件中;
record_last_run => true
# 需要记录查询结果某字段的值时,此字段为true,否则默认tracking_column为timestamp的值;
use_column_value => true
# 需要记录的字段,用于增量同步,需是数据库字段
tracking_column => "id"
# Value can be any of: numeric,timestamp,Default value is "numeric"
tracking_column_type => timestamp
# record_last_run上次数据存放位置;
last_run_metadata_path => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\last_id.txt"
# 是否清除last_run_metadata_path的记录,需要增量同步时此字段必须为false;
clean_run => false
#
# 同步频率(分 时 天 月 年),默认每分钟同步一次;
schedule => "* * * * *"
}
jdbc {
type => "drugs"
# 数据库连接地址
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/hospitalsys?serverTimezone=GMT&characterEncoding=UTF-8&useSSL=false"
# 数据库连接账号密码;
jdbc_user => "root"
jdbc_password => "HRX200138"
# MySQL依赖包路径;
jdbc_driver_library => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\mysql-connector-java-8.0.11.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
# 数据库重连尝试次数
connection_retry_attempts => "3"
# 判断数据库连接是否可用,默认false不开启
jdbc_validate_connection => "true"
# 数据库连接可用校验超时时间,默认3600S
jdbc_validation_timeout => "3600"
# 开启分页查询(默认false不开启);
jdbc_paging_enabled => "true"
# 单次分页查询条数(默认100000,若字段较多且更新频率较高,建议调低此值);
jdbc_page_size => "5000"
# statement为查询数据sql,如果sql较复杂,建议配通过statement_filepath配置sql文件的存放路径;
# sql_last_value为内置的变量,存放上次查询结果中最后一条数据tracking_column的值,此处即为ModifyTime;
# statement_filepath => "mysql/jdbc.sql"
statement => "SELECT * FROM `drug_drugs`"
# 是否将字段名转换为小写,默认true(如果有数据序列化、反序列化需求,建议改为false);
lowercase_column_names => false
# Value can be any of: fatal,error,warn,info,debug,默认info;
sql_log_level => warn
#
# 是否记录上次执行结果,true表示会将上次执行结果的tracking_column字段的值保存到last_run_metadata_path指定的文件中;
record_last_run => true
# 需要记录查询结果某字段的值时,此字段为true,否则默认tracking_column为timestamp的值;
use_column_value => true
# 需要记录的字段,用于增量同步,需是数据库字段
tracking_column => "id"
# Value can be any of: numeric,timestamp,Default value is "numeric"
tracking_column_type => timestamp
# record_last_run上次数据存放位置;
last_run_metadata_path => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\last_id.txt"
# 是否清除last_run_metadata_path的记录,需要增量同步时此字段必须为false;
clean_run => false
#
# 同步频率(分 时 天 月 年),默认每分钟同步一次;
schedule => "* * * * *"
}
jdbc {
type => "doctor"
# 数据库连接地址
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/hospitalsys?serverTimezone=GMT&characterEncoding=UTF-8&useSSL=false"
# 数据库连接账号密码;
jdbc_user => "root"
jdbc_password => "HRX200138"
# MySQL依赖包路径;
jdbc_driver_library => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\mysql-connector-java-8.0.11.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
# 数据库重连尝试次数
connection_retry_attempts => "3"
# 判断数据库连接是否可用,默认false不开启
jdbc_validate_connection => "true"
# 数据库连接可用校验超时时间,默认3600S
jdbc_validation_timeout => "3600"
# 开启分页查询(默认false不开启);
jdbc_paging_enabled => "true"
# 单次分页查询条数(默认100000,若字段较多且更新频率较高,建议调低此值);
jdbc_page_size => "5000"
# statement为查询数据sql,如果sql较复杂,建议配通过statement_filepath配置sql文件的存放路径;
# sql_last_value为内置的变量,存放上次查询结果中最后一条数据tracking_column的值,此处即为ModifyTime;
# statement_filepath => "mysql/jdbc.sql"
statement => "SELECT * FROM `doctor_doctor`"
# 是否将字段名转换为小写,默认true(如果有数据序列化、反序列化需求,建议改为false);
lowercase_column_names => false
# Value can be any of: fatal,error,warn,info,debug,默认info;
sql_log_level => warn
#
# 是否记录上次执行结果,true表示会将上次执行结果的tracking_column字段的值保存到last_run_metadata_path指定的文件中;
record_last_run => true
# 需要记录查询结果某字段的值时,此字段为true,否则默认tracking_column为timestamp的值;
use_column_value => true
# 需要记录的字段,用于增量同步,需是数据库字段
tracking_column => "id"
# Value can be any of: numeric,timestamp,Default value is "numeric"
tracking_column_type => timestamp
# record_last_run上次数据存放位置;
last_run_metadata_path => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\last_id.txt"
# 是否清除last_run_metadata_path的记录,需要增量同步时此字段必须为false;
clean_run => false
#
# 同步频率(分 时 天 月 年),默认每分钟同步一次;
schedule => "* * * * *"
}
jdbc {
type => "department"
# 数据库连接地址
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/hospitalsys?serverTimezone=GMT&characterEncoding=UTF-8&useSSL=false"
# 数据库连接账号密码;
jdbc_user => "root"
jdbc_password => "HRX200138"
# MySQL依赖包路径;
jdbc_driver_library => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\mysql-connector-java-8.0.11.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
# 数据库重连尝试次数
connection_retry_attempts => "3"
# 判断数据库连接是否可用,默认false不开启
jdbc_validate_connection => "true"
# 数据库连接可用校验超时时间,默认3600S
jdbc_validation_timeout => "3600"
# 开启分页查询(默认false不开启);
jdbc_paging_enabled => "true"
# 单次分页查询条数(默认100000,若字段较多且更新频率较高,建议调低此值);
jdbc_page_size => "5000"
# statement为查询数据sql,如果sql较复杂,建议配通过statement_filepath配置sql文件的存放路径;
# sql_last_value为内置的变量,存放上次查询结果中最后一条数据tracking_column的值,此处即为ModifyTime;
# statement_filepath => "mysql/jdbc.sql"
statement => "SELECT * FROM `doctor_doctor_departments`"
# 是否将字段名转换为小写,默认true(如果有数据序列化、反序列化需求,建议改为false);
lowercase_column_names => false
# Value can be any of: fatal,error,warn,info,debug,默认info;
sql_log_level => warn
#
# 是否记录上次执行结果,true表示会将上次执行结果的tracking_column字段的值保存到last_run_metadata_path指定的文件中;
record_last_run => true
# 需要记录查询结果某字段的值时,此字段为true,否则默认tracking_column为timestamp的值;
use_column_value => true
# 需要记录的字段,用于增量同步,需是数据库字段
tracking_column => "id"
# Value can be any of: numeric,timestamp,Default value is "numeric"
tracking_column_type => timestamp
# record_last_run上次数据存放位置;
last_run_metadata_path => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\last_id.txt"
# 是否清除last_run_metadata_path的记录,需要增量同步时此字段必须为false;
clean_run => false
#
# 同步频率(分 时 天 月 年),默认每分钟同步一次;
schedule => "* * * * *"
}
jdbc {
type => "section"
# 数据库连接地址
jdbc_connection_string => "jdbc:mysql://127.0.0.1:3306/hospitalsys?serverTimezone=GMT&characterEncoding=UTF-8&useSSL=false"
# 数据库连接账号密码;
jdbc_user => "root"
jdbc_password => "HRX200138"
# MySQL依赖包路径;
jdbc_driver_library => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\mysql-connector-java-8.0.11.jar"
# the name of the driver class for mysql
jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
# 数据库重连尝试次数
connection_retry_attempts => "3"
# 判断数据库连接是否可用,默认false不开启
jdbc_validate_connection => "true"
# 数据库连接可用校验超时时间,默认3600S
jdbc_validation_timeout => "3600"
# 开启分页查询(默认false不开启);
jdbc_paging_enabled => "true"
# 单次分页查询条数(默认100000,若字段较多且更新频率较高,建议调低此值);
jdbc_page_size => "5000"
# statement为查询数据sql,如果sql较复杂,建议配通过statement_filepath配置sql文件的存放路径;
# sql_last_value为内置的变量,存放上次查询结果中最后一条数据tracking_column的值,此处即为ModifyTime;
# statement_filepath => "mysql/jdbc.sql"
statement => "SELECT * FROM `doctor_doctor_sections`"
# 是否将字段名转换为小写,默认true(如果有数据序列化、反序列化需求,建议改为false);
lowercase_column_names => false
# Value can be any of: fatal,error,warn,info,debug,默认info;
sql_log_level => warn
#
# 是否记录上次执行结果,true表示会将上次执行结果的tracking_column字段的值保存到last_run_metadata_path指定的文件中;
record_last_run => true
# 需要记录查询结果某字段的值时,此字段为true,否则默认tracking_column为timestamp的值;
use_column_value => true
# 需要记录的字段,用于增量同步,需是数据库字段
tracking_column => "id"
# Value can be any of: numeric,timestamp,Default value is "numeric"
tracking_column_type => timestamp
# record_last_run上次数据存放位置;
last_run_metadata_path => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\mysql_es_conf\last_id.txt"
# 是否清除last_run_metadata_path的记录,需要增量同步时此字段必须为false;
clean_run => false
#
# 同步频率(分 时 天 月 年),默认每分钟同步一次;
schedule => "* * * * *"
}
}
filter {}
output {
if [type] == "blog" {
elasticsearch {
# host => "127.0.0.1"
# port => "9200"
# 索引名字,必须小写
hosts => ["127.0.0.1:9200"]
index => "blog"
# 数据唯一索引(建议使用数据库KeyID)
document_id => "%{id}"
template_name=>"myik"
template => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\template\logstash-ik.json"
template_overwrite => true
manage_template =>true
}
}
if [type] == "category" {
elasticsearch {
# host => "127.0.0.1"
# port => "9200"
# 索引名字,必须小写
hosts => ["127.0.0.1:9200"]
index => "category"
# 数据唯一索引(建议使用数据库KeyID)
document_id => "%{id}"
template_name=>"myik"
template => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\template\logstash-ik.json"
template_overwrite => true
manage_template =>true
}
}
if [type] == "drugs" {
elasticsearch {
# host => "127.0.0.1"
# port => "9200"
# 索引名字,必须小写
hosts => ["127.0.0.1:9200"]
index => "drugs"
# 数据唯一索引(建议使用数据库KeyID)
document_id => "%{id}"
template_name=>"myik"
template => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\template\logstash-ik.json"
template_overwrite => true
manage_template =>true
}
}
if [type] == "drug_category" {
elasticsearch {
# host => "127.0.0.1"
# port => "9200"
# 索引名字,必须小写
hosts => ["127.0.0.1:9200"]
index => "drug_category"
# 数据唯一索引(建议使用数据库KeyID)
document_id => "%{id}"
template_name=>"myik"
template => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\template\logstash-ik.json"
template_overwrite => true
manage_template =>true
}
}
if [type] == "tag" {
elasticsearch {
# host => "127.0.0.1"
# port => "9200"
# 索引名字,必须小写
hosts => ["127.0.0.1:9200"]
index => "tag"
# 数据唯一索引(建议使用数据库KeyID)
document_id => "%{id}"
template_name=>"myik"
template => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\template\logstash-ik.json"
template_overwrite => true
manage_template =>true
}
}
if [type] == "doctor" {
elasticsearch {
# host => "127.0.0.1"
# port => "9200"
# 索引名字,必须小写
hosts => ["127.0.0.1:9200"]
index => "doctor"
# 数据唯一索引(建议使用数据库KeyID)
document_id => "%{id}"
template_name=>"myik"
template => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\template\logstash-ik.json"
template_overwrite => true
manage_template =>true
}
}
if [type] == "department" {
elasticsearch {
# host => "127.0.0.1"
# port => "9200"
# 索引名字,必须小写
hosts => ["127.0.0.1:9200"]
index => "department"
# 数据唯一索引(建议使用数据库KeyID)
document_id => "%{id}"
template_name=>"myik"
template => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\template\logstash-ik.json"
template_overwrite => true
manage_template =>true
}
}
if [type] == "section" {
elasticsearch {
# host => "127.0.0.1"
# port => "9200"
# 索引名字,必须小写
hosts => ["127.0.0.1:9200"]
index => "section"
# 数据唯一索引(建议使用数据库KeyID)
document_id => "%{id}"
template_name=>"myik"
template => "D:\elasticSearch\logstash-7.13.3-windows-x86_64\logstash-7.13.3\template\logstash-ik.json"
template_overwrite => true
manage_template =>true
}
}
stdout {
codec => json_lines
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。