【发布时间】:2017-01-05 11:58:39
【问题描述】:
我有这个 logstash 配置文件,查询返回 10547,但在弹性搜索中只看到 10500。 更大的数据显然会产生更多的损失。
为什么?
input {
jdbc {
# Postgres jdbc connection string to our database, mydb
jdbc_connection_string => "jdbc:mysql://outsystemsdemomysql.cxxhlwetgta3.us-east-1.rds.amazonaws.com:3306/outsystems1"
# The user we wish to execute our statement as
jdbc_user => "xxxxx"
jdbc_password => "xxxxx"
# The path to our downloaded jdbc driver
jdbc_driver_library => "mysql-connector-java-5.1.40-bin.jar"
# The name of the driver class for Postgresql
jdbc_driver_class => "com.mysql.jdbc.Driver"
# our query
statement => "SELECT OSUSR_QP0_CONTACT.ID,
CASE WHEN OSUSR_QP0_CONTACT.NAME='' THEN 'Unknown' ELSE OSUSR_QP0_CONTACT.NAME END name,
OSUSR_QP0_CONTACT.TITLE,OSUSR_QP0_CONTACT.PHONE,OSUSR_QP0_CONTACT.ADDRESS,OSUSR_QP0_CONTACT.EMAIL,OSUSR_QP0_ORGANIZATIONTYPE.AKA OrgType
FROM OSUSR_QP0_CONTACT
LEFT JOIN OSUSR_qp0_Organization ON (OSUSR_QP0_CONTACT.ORGANIZATIONID=OSUSR_qp0_Organization.ID)
LEFT JOIN OSUSR_QP0_ORGANIZATIONTYPE ON (OSUSR_qp0_Organization.TYPE=OSUSR_QP0_ORGANIZATIONTYPE.ID)
WHERE OSUSR_QP0_CONTACT.ARCHIVED = 0"
}
}
output {
amazon_es {
hosts => ["search-prochamps-nzv5olnw2mloxwiqd7s3o557we.us-east-1.es.amazonaws.com"]
region => "us-east-1"
# aws_access_key_id, aws_secret_access_key optional if instance profile is configured
aws_access_key_id => "xxxxx"
aws_secret_access_key => "xxxx"
index => "crm"
document_type => "contacts"
document_id => "%{id}"
}
}
【问题讨论】:
-
为了调试这类问题,我使用了两种不同的解决方案: 1. 在调试模式下使用logstash,即使并不总是清楚看到失败的请求是什么。 2.使用本地elasticsearch作为logstash的另一个输出,以便通过日志查看失败的原因。
-
如何在调试模式下使用logstash?另一个奇怪的事情是,如果我添加代码 stdout { codec => rubydebug } 所有数据都会发布
-
我在启动 logstash /opt/logstash/bin/logstash --debug 时使用 --debug 选项
标签: amazon-web-services elasticsearch logstash