Dstat CPU usage for one specific process
You can use command | grep specific_text
for example test dstat | grep puppet
to saving output result in a log file you have two options :
using --output filedstat --time --cpu --top-cputime --output /tmp/dstat.log | grep puppet
using command > filedstat --time --cpu --top-cputime > /tmp/dstat.log | grep puppet
for appendind logs :dstat --time --cpu --top-cputime >> /tmp/dstat.log | grep puppet
here is screenshots of both commands
According to your comments may these commands helps you :
(1) save stats in a file dstat --time --cpu --top-cputime --output my.log
(2) apply filtering to log file and save results to file cat my.log | grep httpd > myhttpd.log
(3) final results cat myhttpd.log
see the screenshot of results here