I have written the following code within the input section, but I'm experiencing a problem where data is being fetched redundantly. Which part should I modify?
logstash.conf
input {
beats {
port => 5044
}
tcp {
port => 50000
}
jdbc {
......
statement => 'SELECT
op.id as "id", p.id as "productId"
FROM product_entity as p
left join product_option_entity as op on op."productId" = p.id
WHERE p."supplierId" IS NOT NULL AND op.id > :sql_last_value ORDER BY op.id ASC'
schedule => "* * * * *"
jdbc_fetch_size => 100
use_column_value => true
tracking_column => "op.id"
tracking_column_type => "numeric"
record_last_run => true
clean_run => true
}
}
filter { ...... }
output {
elasticsearch {
hosts => "elasticsearch:9200"
user => "${LOGSTASH_INTERNAL_PASSWORD}"
password => "${LOGSTASH_INTERNAL_PASSWORD}"
index => "product-db"
manage_template => true
template => '/usr/share/logstash/template/product-template.json'
template_name => "product"
template_overwrite => true
}
stdout { codec => json_lines }
}