In a terminal this works fine:
mosquitto_sub -h 192.168.178.20 -t tele/POW/SENSOR/# | jq '.ENERGY|.Power'
Every 10 seconds there is an output on screen because the device POW publishes it's sensor dates every 10 seconds. The output of mosquitto_sub (it's a JSON string) is piped to jq and jq shows only the value digit of the key 'Power'. Now I try to store the jq output (only the value) to a file 'output.log'.
mosquitto_sub -h 192.168.178.20 -t tele/POW/SENSOR/# | jq '.ENERGY|.Power' > output.log
is not working. What is going wrong?