Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

awk command in ExecuteStreamCommand

Solved Go to solution

awk command in ExecuteStreamCommand

Contributor

Hi!

I need to execute following awk command on flow file via ExecuteStreamCommand processor

awk -F"," '{OFS=","; $4=substr($4,1,19); print $0}'

When run it throws an error: Executable command awk ended in an error: awk: fatal: cannot open file `print $0}" for reading (No such file or directory).


Flow file comes from ListFTP -> FetchFTP -> ExecuteStreamCommand


Could you please help to solve this issue!!

Thank you!!


When running the same awk command on server it works fine:

awk -F"," '{OFS=","; $4=substr($4,1,19); print $0}' myfile.csv



ecs.png
1 ACCEPTED SOLUTION

Accepted Solutions

Re: awk command in ExecuteStreamCommand

Super Mentor

@Gulshan Agivetova

At least one problem i see in your config which is causing the following error:

Executable command awk ended in an error: awk: fatal: cannot open file `print $0}" for reading (No such file or directory



Thsis is because in your . "Command Arguments" you are using semicolon. And in "ExecuteStreamCommand" the "Argument Delimiter" is also set to ";" (which is default delimiter)

May be you can try changing the "Argument Delimiter" to something else then check if you are still getting the same error or not?






1 REPLY 1

Re: awk command in ExecuteStreamCommand

Super Mentor

@Gulshan Agivetova

At least one problem i see in your config which is causing the following error:

Executable command awk ended in an error: awk: fatal: cannot open file `print $0}" for reading (No such file or directory



Thsis is because in your . "Command Arguments" you are using semicolon. And in "ExecuteStreamCommand" the "Argument Delimiter" is also set to ";" (which is default delimiter)

May be you can try changing the "Argument Delimiter" to something else then check if you are still getting the same error or not?






Don't have an account?
Coming from Hortonworks? Activate your account here