Reputation: 5271
I have NiFi flow that runs some shell scripts using the ExecuteStreamCommand processor and the output of the ExecuteStreamCommand is not correct.
The Shell i run is:
if (( $(ps -ef | grep -v grep | grep kibana | wc -l) > 0 )); then echo "1"; else echo "0"; fi;
Is the service is up then 1 if is down then 0, simple but the output is wrong, not matter is the service is up or down the output is always 1.
Here is a demo if the flow:
Upvotes: 0
Views: 1822
Reputation: 31510
Instead of using original relationship use output stream relationship connect to log attribute processor.
if you connect original relation to log attribute that means the contents of generate flowfile is passing to original relationship.
if you connect output stream i.e output of your shell script will be in flowfile content.
Output:-
Content:-
Upvotes: 1