I'm running FreeBSD and have PF firewall set up and this is command i use to display daily number of firewall hits (blocked traffic)
sudo tcpdump -n -e -tttt -r /var/log/pflog | grep $(date +%Y-%m-%d)|wc -l|sed 's/ *//' >> /home/pentago/www/pf.txt
That displays number, say 95.
I want to process pf.txt file in a way that each line has the date before hit count.
- 01-01-2014 - 95
- 02-01-2014 - 98
- 03-01-2014 - 113
- 04-01-2014 - 92
Simply put, I need sed/awk to prepend the date to each new line of the file. Does that sound reasonable?