We want to index data from SQL into ES using Logstash. The data indexed in ES will be a nested object and the nested object has to be constructed by combining data from multiple rows i.e grouping based on some common value.
With my limited knowledge I would write a script that would pull out the data you want from SQL and export as JSON. Filebeat or Logstash could then take that JSON and index it in ES. Or ship directly to ES... I would suggest using Logstash or Filebeat as they handle some errors and log quite well if there are issues.
Thanks @A_B for the reply. My use case is a bit different:
multiple rows from SQL have to be grouped into one JSON object before indexing to ES i.e as the SQL data is normalized with one to many mappings, I would want to denormalize and group all the one to many mappings or similar mappings into a parent object, where anything having one to many mappings would be come a JSON list in the parent object
If it was the case where each row from SQL was to be indexed as a JSON object into ES, then its straight forward.
I'm not suggesting the script would just take one row and export that... You could have a python (well choose what ever language) srcipt select the SQL data you want and construct JSON output that you can ship directly to a Logstash JSON input or have Filebeat ship if you export it as one JSON blob or document per line.
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.