Nick Mcdonald
New member
Hi,
I've been trying to solve this in Perl and I have no clue so I'm stuck. I do code in C but pretty new in Perl. This is what I am trying to achieve is:
I have a log file that contain log messages and separated by newline characters. Need to write a Perl program that finds the top 8 most reappeared log messages? Please note that the log file might be too big to fit in the memory at one time.
Think about that the log file has a format similar to Linux syslog format as follows:
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol unlock_page
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol generic_file_read
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol generic_file_write
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol generic_file_mmap
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol generic_file_sendfile
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: disagrees about version of symbol zone_table
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol zone_table
Mar 9 08:15:05 gen-vcs11 kernel: kjslahdisagrees about version of symbol unlock_page
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol unlock_page
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol filemap_fdatawrite
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol find_or_create_page
so on .....
Any help would be greatly appreciated!
Thanks!
Could you please send me the code in Perl
Hi,
Thanks and could you please help me with the code in Perl for this problem.
Thank you.
I've been trying to solve this in Perl and I have no clue so I'm stuck. I do code in C but pretty new in Perl. This is what I am trying to achieve is:
I have a log file that contain log messages and separated by newline characters. Need to write a Perl program that finds the top 8 most reappeared log messages? Please note that the log file might be too big to fit in the memory at one time.
Think about that the log file has a format similar to Linux syslog format as follows:
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol unlock_page
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol generic_file_read
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol generic_file_write
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol generic_file_mmap
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol generic_file_sendfile
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: disagrees about version of symbol zone_table
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol zone_table
Mar 9 08:15:05 gen-vcs11 kernel: kjslahdisagrees about version of symbol unlock_page
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol unlock_page
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol filemap_fdatawrite
Mar 9 08:15:05 gen-vcs11 kernel: kjslah: Unknown symbol find_or_create_page
so on .....
Any help would be greatly appreciated!
Thanks!
Could you please send me the code in Perl
Hi,
Thanks and could you please help me with the code in Perl for this problem.
Thank you.