Documentation Index
Fetch the curated documentation index at: https://grafana_com_website/llms.txt
Fetch the complete documentation index at: https://grafana_com_website/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: /docs/k6/latest/using-k6/secret-source/file.md (append .md) or send Accept: text/markdown to /docs/k6/latest/using-k6/secret-source/file/. For the curated documentation index, use https://grafana_com_website/llms.txt. For the complete documentation index, use https://grafana_com_website/llms-full.txt.
File secret source
The file secret source loads secrets from a plain text file.
Each line in the file contains one secret in key=value format:
secret=very secret
someotherkey=another secretTo use the file secret source, specify the file path with the --secret-source flag:
k6 run --secret-source=file=secrets.file script.jsdocker run -it --rm \
-v <SCRIPT_DIR>:/scripts \
grafana/k6 run --secret-source=file=/scripts/secrets.file /scripts/script.jsIn the Docker example, replace <SCRIPT_DIR> with the absolute path to the directory that contains your script and secrets file.
Was this page helpful?
Related resources from Grafana Labs

