p1 = subprocess.Popen(['cat', 'file.log'], stdout=subprocess.PIPE)
p2 = subprocess.Popen(['tail', '-1'], stdin=p1.stdout, stdout=subprocess.PIPE)
p1.stdout.close()
output, err = p2.communicate()
Call a shell command containing a 'pipe' from Python and capture STDOUT