Join mysql table with ealsticsearch index

Hi All,

I want to join table in mysql database with elasticsearch index document.

For ex: I want to fetch log related to user.
Logs are store on elastic search unsed userlog dcoument, which is having userID attribute.
And user details store in "USER" on MYSQL databse.

I want to join user table with index to display log with user name and some other details from user table and log from elasticsearch.

Please help me to achieve this.

Thanks
Basanagouda

You can't do that I think at search time.

You can though enrich your log at index time by using logstash and the JDBC filter where for each log entry you can ask the database for more details and put those details in the final document before it is sent to elasticsearch.

If the database is "static", you can use https://www.elastic.co/guide/en/logstash/current/plugins-filters-jdbc_static.html
If not, look at https://www.elastic.co/guide/en/logstash/current/plugins-filters-jdbc_streaming.html

HTH

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.