title: How to pass argument to command from pipe?
body: <p>I use the <code>tail</code> command on apache2 <code>access_log</code>, then by piping that output to <code>cut</code> I can get the ip address in real time, but then I need to process each line in real time with <code>iptables</code>.</p>
  
  <p>I try to do that this way:</p>
  
  <pre><code>tail -f access_log | cut -d' ' -f 1 | xargs iptables -A INPUT -j DROP -s
  </code></pre>
  
  <p>But it does not work.</p>
  
  <p>How to call iptables for each line in real time?</p>