# logs2k6 > Turns real production traffic into a readable k6 load test you can commit: the real endpoint mix at the real peak-hour rate. Reads an aggregated usage table (requests per method + templated path per hour), finds the busiest hour, and writes `load.js` (one constant-arrival-rate scenario per endpoint) and `load.report.md` (the mix and what was left out). Zero dependencies, works offline, never reads raw logs; the generated script contains no host from your logs. Status: v0.1, early. Website: https://talik.dev/logs2k6/ · Repo: https://github.com/talikbaku/logs2k6 · npm: https://www.npmjs.com/package/logs2k6 ## Install and run - Needs Node.js >= 20 (22 or 24 recommended) and k6 to run the result. - Usage table from logs (with api-dead-ends): `npx api-dead-ends convert accesslog access.log --hourly -o usage.csv` - Script at the busiest hour, 10% of production load: `npx logs2k6@0.1.0 from-usage usage.csv --peak --scale 0.1 -o load.js` - Run against staging, never production: `PARAM_ID=42 BASE_URL=https://staging.example.test k6 run load.js` - Synthetic example: `logs2k6 sample -o usage.csv` ## Main options - `--peak` (default) or `--avg`; `--scale ` fraction of production RPS; `--top `; `--min-share `; `--exclude-method`; `--include-writes` (non-GET scenarios are generated but off by default); `--duration`; `--window`; `--p95 `; `-o load.js`; `--report` / `--no-report`. ## Input CSV/JSON/JSONL: `method,path,calls,first_seen,last_seen,status[,day][,hour]`, paths already templated (`/api/v1/orders/{id}`). With `hour` you get the busiest hour; with only `day`, a 24-hour average of the busiest day. Details: https://github.com/talikbaku/logs2k6/blob/main/docs/INPUT.md ## Limits - Reproduces the request mix and rate, not sessions: one request per iteration, no journeys, think time, auth, query strings or headers. - The peak is the busiest hour's average; bursts inside it are higher. - The status column is not used; failing endpoints are generated like the rest. - Rates are rounded to whole requests per second, minute or hour; rare endpoints get few requests in a short run. - Each scenario has fixed VU limits; check k6 `dropped_iterations` before trusting the result. ## Family - api-dead-ends (https://talik.dev/api-dead-ends/): the same traffic vs your OpenAPI spec — failing, unused and undocumented endpoints. - curl2k6 (https://talik.dev/curl2k6/): a curl, HAR file, Postman collection or OpenAPI spec → a k6 load test and a regression check. - All tools: https://talik.dev/ ## Contact - Questions: done@talik.dev · Security: security@talik.dev