Help w/ script to read file and parse log message
Hi,
I am working on the script to parsing the specific message like "aaaa" in multiple log files like N1-***,N2-***,N3-***... The script is to find the list of lof files which contains the message "aaaa" and export the list into excel filE. Can anyone give help? Thanks |
Hello,
If the pattern "aaaa" is more specific, then a simple grep should do. Quote:
|
thanks.
I am not very famiar to perl. Can bash shell can accomplish this? |
Quote:
So, do it in bash and save as CSV, or learn Perl. Either way, YOU need to do the work. We are not going to write the code for you. Post what you've written, and where you're getting stuck, and we can "give help". Otherwise, there are many scripting tutorials you can find on Google. |
Try using awk. it will do a bit more than just grep.
example: Code:
awk -F'[ .]' '/aaaa/ { print $6 "," $1 "," $2 }' Example: Code:
$>cat << EOINPUT | awk -F'[ .]' '/aaaa/ { print $6 "," $1 "," $2 }' |
All times are GMT -5. The time now is 03:39 PM. |