Logstash 未将完整数据从 oracle 加载到 Elasticsearch

Logstash not loading complete data from oracle to Elasticsearch

我正在尝试将 oracle 数据加载到 elasticsearch 中,加入 5 table 后,它的近 300k 条记录就在那里。但是在执行 logstash 配置文件后,elasticsearch 中只有 79511 个文档可用。

我试了两次,但得到了相同的结果。我在 Oracle 中进行了交叉验证,并确信几乎有 300k 条记录。

如果我输入 stdout { codec => rubydebug },那么完成该过程需要很长时间。

关于这个问题的任何想法。

请找到我的 logstash 配置文件(我没有在此处包含 sql 查询)。

input {
      jdbc {
        jdbc_driver_library => "D:SearchEngine\data\ojdbc8.jar"
        jdbc_driver_class => "Java::oracle.jdbc.OracleDriver"
        jdbc_connection_string => "jdbc:oracle:thin:@localhost:1525/demodb"     
        jdbc_user => "demo"
        jdbc_password => "1234567"
        jdbc_fetch_size => "50000"
        statement => "" 
        }
    }

    output {

        elasticsearch {
        hosts => ["localhost:9200"]
        index => "replacement_local101"
        document_id => "%{id}"
        }

    }

这是因为您没有为schedule

指定配置

Input from this plugin can be scheduled to run periodically according to a specific schedule. This scheduling syntax is powered by rufus-scheduler. The syntax is cron-like with some extensions specific to Rufus (e.g. timezone support ).

默认只运行一次,

There is no schedule by default. If no schedule is given, then the statement is run exactly once.

您需要提供schedule选项。例如,以下将 运行 每秒,

schedule => "* * * * *"

您可以阅读有关 syntax here

的更多信息