I am trying to accomplish an idea which i really don't know how to do it. Basically i am trying to capture the value through grep command as shown below
p = subprocess.Popen('tail -f /data/qantasflight/run/tomcat/logs/localhost_access_log.2016-02-29.txt | grep /qantas-ui/int/price?', stdout=subprocess.PIPE, shell = True)
stdout = p.communicate()[0]
Process the stdout value and then push the value as shown below
f = urllib.urlopen("http://162.16.1.90:9140/TxnService", params2)
param2 is the value where i will process the result given by the subprocess.Popen
In a nutshell i want the following :
-- Wait for the new value --> -- Process the value --> -- Push the value -->
This should be realtime and the python script will keep on getting the new value, process it and then push the value.