k6 run --out json=results.json script.js

Category: Web App Development

k6 run --out json=results.json script.js

Export k6 results to a JSON file

Runs the test and streams metrics into results.json for later analysis or graphing. The --out flag accepts named outputs like json, csv and experimental-prometheus-rw. Point several outputs at once by repeating the flag.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.