#Filter output from Container#withExec ... Container#stdout

1 messages · Page 1 of 1 (latest)

uncut helm
#

This questions applies to all SDK.

I'm running a maven build process with dagger. The amount of output logs being produced while build runs is huge. Can I somehow apply a filter on that running process?

E.g. Somehow on Container#stdout?

Or do I need to pipe the command to some grep command or so?

Thank you

inland condor
#

Yeah, you'd need to pipe to grep unless the command you run has some flags you can use to reduce the voerbosity.

uncut helm
#

right, so I do that like this?

cnt.withExec([
"mvn", "install" , "|", "grep -v whatever"])
.stdout()

inland condor
#

No, for pipes, you need to wrap the command in a shell:

cnt.withExec(["sh", "-c", "mvn install | grep -v whatever"]).stdout()