I'm trying to highlight some key words as tailing a log file using a perl script;
about my case:
- I want to search for a keyworrs just once and highligt all occurrence of them.
- I want just highlit the keywords but not the whole line
but the problems are that
- perl just catches the first keyword in a line and skip checking for other occurrence. for example if a line like "Error: some exception happen, Unable to process" it just highlight the error and do not process the remain part of the line where it should hilight the word "exception" and "Unable"
- 2-How can I do some action if for exapmle at least 4 time "unable" message appear ( not just in one line but diffrent line)in
below is how I use perl search and replace :
Code:
s/(?:(unable|exception|warning))/\e[1;31$&.......
Thanks in Advance..