title: How can I redirect tail -f output to curl (HTTP stream)
body: <p>I want to collect realtime logs from embedded devices. The device have limited command. It would be great if I can do it by a shell script.</p>
  
  <p>So, can I do something like this <code>tail -f /var/logs/some-log.log | curl -X POST --data-urlencode @- http://&lt;log-collaction.website&gt;</code>?</p>
  
  <p>I have tried many ways, but all failed. For example:</p>
  
  <pre><code>ping www.google.com | while read -r LINE; do curl -X POST --silent --data-binary $LINE "http://localhost:8080/"; done
  </code></pre>
  
  <p>The above command works, but it will post messages line by line. However, I think the performance is not good if I have a lot of content to send. </p>
  
  <p>I know HTTP/1.1 support chunked encoding. How can I redirect a program's stdout to <code>curl</code> or a HTTP stream (maybe long connection?).</p>
  
  <p>Thanks</p>