5

using awk to get specific section of lines in logs

view full story
linux-howto

http://www.unix.com – i have a log file that has the date and time that looks like this: Code: Wed Jun 28 15:46:21 2012 test failed tailed passed passed not error panic what we want to focus on is the first 5 columns because they contain the date and time. the date and time can be anywhere on the line. in this particular case, the date and time is at the beginning of the line. my question is, what happens if it is somewhere else on that line? how can i make it so that when i run a one liner awk command, it finds the date and time wherever it is on the line? OS: linux and sunos shell: bash (HowTos)