dynamodb-stream-elasticsearch icon indicating copy to clipboard operation
dynamodb-stream-elasticsearch copied to clipboard

[Suggestion] customizable index and type based on record contents

Open jeff-k-lee opened this issue 6 years ago • 3 comments

I had been using dynamo2es-lambda and saw this module is more lightweight and relies on less dependencies than the other module. However this module routes all records to a fixed index and type in elasticsearch.

The other module dynamod2es-lambda has this concept of indexField and typeField in configuration that allows each incoming record to be routed to different indexes or types depending on the record's contents. I am wondering if this feature will be difficult to add.

Example: DynamoDB source table: "fruit_samples"

Configuration: indexField: ["genus", "species"] typeField: "genus" seperator: "-"

Elasticsearch destinations: index: "citrus-citrus_limon", type: "citrus" index: "citrus-citrus_sinensis", type: "citrus" index: "prunus-prunus_domestica", type: "prunus"

jeff-k-lee avatar Dec 08 '18 01:12 jeff-k-lee

I will investigate this topic.

matrus2 avatar Dec 13 '18 13:12 matrus2

This can be done by transform function. But currently it is applied only to modify/insert events, to make it work entirely it is required to be added to remove event as well. It requires breaking change to be introduced.

matrus2 avatar Jul 23 '19 16:07 matrus2

How is the investigation going? I modified the package long time ago for custom indices.

Would look into it again if we find a way not to make it a breaking change....

franz101 avatar Jun 11 '20 23:06 franz101