I will send.
logstash.conf
Sample Logstash configuration for creating a simple
Beats -> Logstash -> Elasticsearch pipeline.
input {
elasticsearch {
hosts => ["[127.0.0.1:9200](http://127.0.0.1:9200)"]
user => "elastic"
password => "wOedcSjME082qVMPckhR"
}
jdbc {
jdbc_driver_library => "/usr/share/logstash/mysql-connector-java-8.0.12.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
jdbc_connection_string => 'jdbc:mysql://[153.126.196.248:3306/model_on?useSSL=true&requireSSL=true&verifyServerCertificate=true&trustCertificateKeyStoreUrl=file:///home/ubuntu/elastickey.jks&trustCertificateKeyStoreType=JKS&trustCertificateKeyStorePassword=MSeven11At8n](http://153.126.196.248:3306/model_on?useSSL=true&requireSSL=true&verifyServerCertificate=true&trustCertificateKeyStoreUrl=file:///home/ubuntu/elastickey.jks&trustCertificateKeyStoreType=JKS&trustCertificateKeyStorePassword=MSeven11At8n)'
jdbc_user => "elasticsearch"
jdbc_password => "MSeven11At8n"
statement => "SELECT request_d_c.*,[s1.name](http://s1.name),site.company,site.site_name,[account.name](http://account.name) as user_name,account.department as department_name,[device_type.name](http://device_type.name) as device_name,[simulator.name](http://simulator.name) as simulator_name,[mdc_quality.name](http://mdc_quality.name) as quality_name,[model_type.name](http://model_type.name) as type_name,[model_detail.name](http://model_detail.name) as detail_name,[source_type.name](http://source_type.name) as source_name FROM model_on.request_d_c
left join site on request_d_c.site_id = site.site_id
inner join account on request_d_c.user_id=account.id
left join device_type on request_d_c.device_type_id = device_type.id
left join simulator on request_d_c.simulator_id = simulator.id
left join mdc_quality on request_d_c.mdc_quality_id = mdc_quality.id
left join model_type on request_d_c.model_type_id = model_type.id
left join model_detail on request_d_c.model_detail_id = model_detail.id
left join source_type on request_d_c.source_type_id = source_type.id
left join device_type_map on request_d_c.device_id = device_type_map.device_id
left join device_type as s1 on device_type_map.device_type_id = s1.id where account.name <> 'Roman Reigns' and request_d_c.site_id <> '' and request_d_c.subscription_id <> '' and site.company <> '株式会社モーデック' and request_d_c.request_type='1';"
type => "download"
}
}
output {
if [type] == "download" {
elasticsearch {
manage_template => false
hosts => ["[127.0.0.1:9200](http://127.0.0.1:9200)"]
user => "elastic"
password => "wOedcSjME082qVMPckhR"
index => "modelon"
document_id => "%{id}"
}
stdout {codec => rubydebug {metadata => true }}
}
}