-
Notifications
You must be signed in to change notification settings - Fork 0
/
import_from_db.conf
34 lines (32 loc) · 1.28 KB
/
import_from_db.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
input {
jdbc {
type = "social-engineer"
#type字段统一设置为social-engineer
jdbc_driver_library => "C:\Program Files\logstash\sqljdbc_4.1\chs\sqljdbc41.jar"
#指定jdbc驱动jar文件的完整路径
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
#选择jdbc
jdbc_connection_string => "jdbc:sqlserver://127.0.0.1:1433;databaseName=room"
#配置jdbc的连接字符串
jdbc_user => "sa"
jdbc_password => "xxxxxxx"
#配置数据库的连接账户和密码
jdbc_paging_enabled => "true"
jdbc_page_size => "50000"
#配置缓存大小
statement => "SELECT [Name],[CardNo],[CtfTp],[CtfId],[Gender],[Birthday],[Address],[Zip],[FirstNm],[LastNm],[Mobile],[Tel],[Fax],[EMail],[Version] FROM [dbo].[cdsgus]"
#配置查询语句,换句话说,logstash是把一个特定的查询结果进行解析
}
}
filter {
#如果需要删除或添加特定的字段,在这里配置
}
output {
elasticsearch {
hosts => ["10.105.42.0:9200","10.105.210.93:9200"] #解析完毕的数据直接保存到ES中
index => "room-jiexian-%{+YYYY.MM.dd}" #命名格式:数据来源-操作人-时间,时间字段会自动生成
}
stdout{
codec => rubydebug
}
}