InsideDarkWeb.com

Use data from Mysql to ElasticSearch with Logstash

I’m using logstash for use my mysql database in ElasticSearch

My conf is the next.

input {
    jdbc {
        jdbc_connection_string => "jdbc:mysql://[ip]:3306/nextline_dev"
        jdbc_user => "[user]"
        jdbc_password => "[pass]"
        #schedule => "* * * * *"
        #jdbc_validate_connection => true
        jdbc_driver_library => "/path/mysql-connector-java-6.0.5.jar"
        jdbc_driver_class => "com.mysql.cj.jdbc.Driver"
        statement => "SELECT * FROM Account"
    }
}
output {
    elasticsearch {
        index => "account"
        document_id => "%{id}"
        hosts => ["127.0.0.1:9200"]
    }
}

But I have some questions, I want to schedule more than one query, but the index will be always account.

Can I make a dynamic index for the output to elasticsearch? And how can I use more than one statement? (Export more than one table)

Database Administrators Asked by BlueSeph on November 21, 2021

1 Answers

One Answer

I found that ELK LogStash 6.X have document_id deprecated, so if I use my configuration without document_id it works.

Answered by BlueSeph on November 21, 2021

Add your own answers!

Related Questions

Order by certain enum values first

1  Asked on January 30, 2021 by milkncookiez

     

I have 600% high CPU usage mysqld

1  Asked on January 30, 2021 by alfredo

     

How to create a SELECT statement involving a subtype

1  Asked on January 26, 2021 by elephantcoder

       

How to move SSISDB database

2  Asked on January 24, 2021 by jac

       

Ident authentication failed for user “postgres”

1  Asked on January 23, 2021 by lloyd-thomas

       

Creacte Mysql Database copy

1  Asked on January 20, 2021 by viktor-mandrika

 

Fetching Remote Encryption Key for MariaDB

1  Asked on January 14, 2021 by vince-kronlein

   

SQL Server :: how to move country code column to another table?

1  Asked on January 9, 2021 by francesco-mantovani

       

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.