{"record":{"id":"549e90000a4085d8","repo":"grafana/k6","slug":"unknown-key-q-as-argument-for-csv-output","errorCode":null,"errorMessage":"unknown key %q as argument for csv output","messagePattern":"unknown key %q as argument for csv output","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/output/csv/config.go","lineNumber":88,"sourceCode":"\n\tpairs := strings.SplitSeq(arg, \",\")\n\tfor pair := range pairs {\n\t\tk, v, _ := strings.Cut(pair, \"=\")\n\t\tif v == \"\" {\n\t\t\treturn c, fmt.Errorf(\"couldn't parse %q as argument for csv output\", arg)\n\t\t}\n\t\tswitch k {\n\t\tcase \"saveInterval\":\n\t\t\terr := c.SaveInterval.UnmarshalText([]byte(v))\n\t\t\tif err != nil {\n\t\t\t\treturn c, err\n\t\t\t}\n\t\tcase \"fileName\":\n\t\t\tc.FileName = null.StringFrom(v)\n\t\tcase \"timeFormat\":\n\t\t\tc.TimeFormat = null.StringFrom(v)\n\t\tdefault:\n\t\t\treturn c, fmt.Errorf(\"unknown key %q as argument for csv output\", k)\n\t\t}\n\t}\n\n\treturn c, nil\n}\n\n// GetConsolidatedConfig combines {default config values + JSON config +\n// environment vars + arg config values}, and returns the final result.\nfunc GetConsolidatedConfig(\n\tjsonRawConf json.RawMessage, env map[string]string, arg string,\n) (Config, error) {\n\tresult := NewConfig()\n\tif jsonRawConf != nil {\n\t\tjsonConf := Config{}\n\t\tif err := json.Unmarshal(jsonRawConf, &jsonConf); err != nil {\n\t\t\treturn result, err\n\t\t}\n\t\tresult = result.Apply(jsonConf)","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/output/csv/config.go#L70-L106","documentation":"ParseArg for the csv output validates each comma-separated key=value option; any key other than saveInterval, fileName, or timeFormat reaches this default branch. It means the user passed an unsupported option name to the csv output's config string, so the output cannot be configured and k6 aborts startup.","triggerScenarios":"Thrown at internal/output/csv/config.go:88 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the misspelled key or remove it from the --out csv=... argument","Use only saveInterval, fileName and timeFormat keys"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}