in ingestion-sink/src/main/java/com/mozilla/telemetry/ingestion/sink/config/SinkConfig.java [170:199]
Output getOutput(Env env, Env commonEnv, Executor executor) {
final String outputPipe = env.getString(OUTPUT_PIPE);
final PrintStream pipe;
switch (outputPipe) {
case "-":
case "1":
case "out":
case "stdout":
case "/dev/stdout":
pipe = System.out;
break;
case "2":
case "err":
case "stderr":
case "/dev/stderr":
pipe = System.err;
break;
default:
try {
pipe = new PrintStream(outputPipe);
} catch (FileNotFoundException e) {
throw new IllegalArgumentException(e);
}
}
return new Output(this,
Pipe.Write.of(pipe, env.optString(OUTPUT_TABLE)
.map(PubsubMessageToTemplatedString::forBigQuery).orElse(null),
getFormat(env, commonEnv)),
commonEnv);
}