What I'm doing: Created 4 conf files under a root directory called XYZ. Each of these conf files will import 1000 rows from SQL and tables being imported are unique in all 4 conf files. when ran separately the number of documents created are 1000 in each index but when running conf file with root folder as argument the count is not 1000 in indexes.
I've also observed each index is picking different document. I'm also using templates for each of the index and template name is different all across.
I've given different index names and different document names in all configfiles. But, somehow the number of documents created in each of the indexes is different from expected.
However, when i run configfiles seperately the number of docs created are correct
I'm not sure what is happening without seeing the configuration files, but remember that in logstash, if you run it with multiple configuration files, they will all be concatenated and evaluated as a single one.
So, be sure to confirm if you have unnecessarily duplicate input/filter/output sections.
i cant share the whole config file but each conf file is fetching data from single table and writing to a single table. Similar to below i have 4 conf files for each table under a root directory
input {
jdbc {
jdbc_driver_library => "/h"
jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
jdbc_connection_string => "jdbc:sqlserver://"
jdbc_user => "ReadOnly"
jdbc_password => "" #lowercase_column_names => false #schedule => "*/10 * * * *"
clean_run => true
use_column_value => true
tracking_column => ***
record_last_run => true #used for incremental updates of record by having a reference point in ../jinfo
last_run_metadata_path => "/etc/logstash/run_metadata.d/"
statement => "SELECT *
FROM [a] where [a] > :sql_last_value order by [amd] asc" #jdbc_paging_enabled => "true" #jdbc_page_size => "50000" #statement_filepath => "query.sql"
}
}
filter {
If so, when you execute bin/logstash -f *.conf, all your N files will be merged into one, which means that you now have N jdbc blocks, but also N elasticsearch blocks, which means that for each event one of the jdbc blocks produces, you're sending it N times instead of one.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.