# @mapbox/aws-log-replay

> Transform and replay CloudFront, ELB Classic, and ALB logs.

Latest version **4.3.0** (published 2026-03-18) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install @mapbox/aws-log-replay
pnpm add @mapbox/aws-log-replay
yarn add @mapbox/aws-log-replay
bun add @mapbox/aws-log-replay
```

Provides the commands `sample`, `pathreplay`, `generatepath`.

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 4.3.0 |
| Published | 2026-03-18 |
| First published | 2022-08-09 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=18 |
| Dependencies | 6 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mapbox |
| Maintainers | mapbox-npm-01, mapbox-npm-02, mapbox-npm-07, mapbox-npm-03, mapbox-npm-04, mapbox-npm-09, mapbox-npm-05, mapbox-npm-06, mapbox-npm-08, mapbox-npm-advanced-actions, mapbox-npm-ci, mapbox-npm, mapbox-admin, mapbox-machine-user, mbx-npm-ci-staging, mbx-npm-ci-production, mbx-npm-01-production, mbx-npm-02-production, mbx-npm-03-production, mbx-npm-04-production, mbx-npm-05-production, mbx-npm-06-production, mbx-npm-07-production, mbx-npm-08-production, mbx-npm-09-production, mbx-npm-02-staging, mbx-npm-advanced-actions-staging, mbx-npm-advanced-actions-production |

## Links

- npm: https://www.npmjs.com/package/@mapbox/aws-log-replay
- npm.io page: https://npm.io/package/@mapbox/aws-log-replay

## Dependencies (6)

- [got](https://npm.io/package/got.md) ^11.8.6
- [split](https://npm.io/package/split.md) ^1.0.1
- [minimist](https://npm.io/package/minimist.md) ^1.2.8
- [safe-regex2](https://npm.io/package/safe-regex2.md) ^5.0.0
- [agentkeepalive](https://npm.io/package/agentkeepalive.md) ^3.5.1
- [parallel-stream](https://npm.io/package/parallel-stream.md) ^1.1.2

## Recent versions

- 4.3.0 (latest) — 2026-03-18
- 4.3.0-dev.0 (dev) — 2026-03-12
- 4.2.0 — 2025-09-05
- 4.1.0 — 2023-12-20
- 4.1.0-dev.5 — 2023-12-20
- 4.1.0-dev.4 — 2023-12-20
- 4.1.0-dev.3 — 2023-12-20
- 4.1.0-dev.2 — 2023-12-20
- 4.1.0-dev.1 — 2023-12-15
- 4.0.0 — 2023-09-27
- 4.0.0-dev.3 — 2023-09-26
- 4.0.0-dev.2 — 2023-09-26
- 4.0.0-dev.1 — 2023-09-26
- 2.7.0-dev7 — 2022-08-10
- 2.7.0-dev6 — 2022-08-10
- … 1 more at https://npm.io/package/@mapbox/aws-log-replay/versions

## README

# aws-log-replay

```
npm i @mapbox/aws-log-replay
```

Transform and replay a stream of AWS CloudFront, ELB Classic, or ALB logs. You can use [s3scan](https://github.com/mapbox/s3scan) to easily stream logs into these tools.

This project uses the AWS JavaScript SDK: you will need to [configure your own credentials](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html).

## generatepath

Takes different types of logs as input and streams  an object to `stdout`. Format of the output:
```js
{
  "path": "/a.json?option=1", 
  "method": "GET", // can be GET or HEAD
  "referer": "Referer" // for 'cloudfront' type only
}
```
Supported types include "cloudfront" for CloudFront logs and "lb" for ELB Classic or ALB logs.

```sh
Usage: generatepath <type>
```

## pathreplay

Makes replay requests to the `baseurl`. Expects paths to be piped to `stdin`. (Optional) Control concurrency of replay requests with `--concurrency` flag. Default is 100.

```sh
Usage: pathreplay <baseurl> [--concurrency=<n>]
```

## sample

Emits a repeatable set of input lines piped to `stdin` at a given sampling rate. The number of lines emitted will approach the specific rate over sufficiently large samples, but may diverge for small sample sizes. Sampling rates should be specified as a decimal number between zero and one. Optionally accepts a `filter` argument that restricts the sampled set to lines matching the specified regular expression.

```sh
Usage: sample --rate=<rate> [--filter=<filter>]
```

---
_Source: https://npm.io/package/@mapbox/aws-log-replay · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
