I\'ve got supervisor\'s status output, looking like this.
frontend RUNNING pid 16652, uptime 2:11:17
nginx
Solution with awk and cut
vinko@parrot:~$ cat test
frontend RUNNING pid 16652, uptime 2:11:17
nginx RUNNING pid 16651, uptime 2:11:17
redis RUNNING pid 16607, uptime 2:11:32
vinko@parrot:~$ awk '{print $4}' test | cut -d, -f 1
16652
16651
16607
for nginx only:
vinko@parrot:~$ grep nginx test | awk '{print $4}' | cut -d, -f 1
16651