# Convert from dynamodb json to regular json on ingest

**URL:** <https://discuss.elastic.co/t/convert-from-dynamodb-json-to-regular-json-on-ingest/263298>\
**Category:** Beats\
**Tags:** functionbeat\
**Created:** [February 4, 2021, 8:48pm UTC](https://discuss.elastic.co/t/convert-from-dynamodb-json-to-regular-json-on-ingest/263298 "2021-02-04T20:48:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryantomaselli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryantomaselli/32/83397_2.png) [@ryantomaselli](https://discuss.elastic.co/u/ryantomaselli)\
**Post date:** [February 4, 2021, 8:48pm UTC](https://discuss.elastic.co/t/convert-from-dynamodb-json-to-regular-json-on-ingest/263298/1 "2021-02-04T20:48:39Z")

</div>

Hey guys;

I'm ingesting DynamoDB stream data into Elastic using a function beat.

Thing is the data ingested is all DynamoDB JSON rather than regular JSON.

The AWS SDK has a method to do the conversion (see [Module: AWS.DynamoDB.Converter — AWS SDK for JavaScript](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/Converter.html#unmarshall-property)) but how might I accomplish this as part of a function beat.

```auto
var unmarshalled = AWS.DynamoDB.Converter.unmarshall({
  string: {S: 'foo'},
  list: {L: [{S: 'fizz'}, {S: 'buzz'}, {S: 'pop'}]},
  map: {
    M: {
      nestedMap: {
        M: {
          key: {S: 'value'}
        }
      }
    }
  },
  number: {N: '123'},
  nullValue: {NULL: true},
  boolValue: {BOOL: true}
});

```

Any pointers joyously appreciated.

Cheers

---

<div class="post-metadata">

**Author:** ![ryantomaselli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ryantomaselli/32/83397_2.png) [@ryantomaselli](https://discuss.elastic.co/u/ryantomaselli)\
**Post date:** [February 9, 2021, 3:48pm UTC](https://discuss.elastic.co/t/convert-from-dynamodb-json-to-regular-json-on-ingest/263298/2 "2021-02-09T15:48:52Z")

</div>

Function Beat does not have this level of formatting control. Using Logstash would be the way to go here or write to the index directly in the desired format.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 9, 2021, 5:49pm UTC](https://discuss.elastic.co/t/convert-from-dynamodb-json-to-regular-json-on-ingest/263298/3 "2021-03-09T17:49:05Z")

</div>

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