Skip to content

Commit

Permalink
Merge pull request #65 from keegoid-nr/kmullaney/encoding
Browse files Browse the repository at this point in the history
docs: update encoding and headers
  • Loading branch information
yahmed153 authored Jun 9, 2022
2 parents cc828dd + cadc8ca commit 02391d8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,22 @@ If your payload exceeds this size, you will need to split it into pieces:

<https://github.com/newrelic/aws-log-ingestion/blob/1430a247f1fb5feb844f0707838a6ef48d21fc41/src/function.py#L292-L306>

The payload should be gzipped before sending:
The payload should be utf-8 encoded and then gzipped before sending:

<https://github.com/newrelic/aws-log-ingestion/blob/1430a247f1fb5feb844f0707838a6ef48d21fc41/src/function.py#L298>

The following GNU coreutils Bash command will reproduce the desired payload encoding and compression:

```sh
xclip -sel clip -o | iconv -cf utf-8 | gzip > payload.gz
```

Required headers include:

* <https://github.com/newrelic/aws-log-ingestion/blob/1430a247f1fb5feb844f0707838a6ef48d21fc41/src/function.py#L360-L361>
* `Content-Length`
* `Host`
* `Accept-Encoding: gzip`
* `Content-Length: <calculated when request is sent>`
* `Host: <calculated when request is sent>`

The payload should include the following (properly escaped) elements[^1]:

Expand Down

0 comments on commit 02391d8

Please sign in to comment.