I'm using Logstash as a ETL tool to copy data from Elastic index to DB table. I tried to map a nested field using following insert statement in the logstash configuration;
That did not work unfortunately. Unlike previously where other data fields had data added, with what you have proposed, none of the fields in the database table is populated.
I am assuming that you are using the community jdbc output plugin. That is not supported by Elastic and the author no longer maintains it, so there is nobody you can go to for support.
My reading of the code that adds parameters to the statement is that either version of your statement option should work. I do not know what to suggest.
However I do not see any errors when using "[products][productId]".
It is difficult to debug when no errors are shown.
In Elasticsearch document structure products is an array of product objects which would appear as follows; { "description": "This is a test product", "products": [ { "productId": "23232", "country": "AU" } ] }
Since there can be more than one productId if multiple products exist within products object array it wouldn't be possible to match the correct field. Could this be the reason for not being able to capture the nested field productId ?
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.