[CentOS] Log File Reviewing

Steve Huff shuff at vecna.org
Mon Jan 5 20:15:44 UTC 2009


On Jan 5, 2009, at 2:56 PM, Joseph L. Casale wrote:

>> The regex you want is "^[[:space:]]*word"
>
> Wow, thanks everyone for the help! How does one modify this to also  
> knock out
> lines that *must* have whitespace followed by a number [0-9]? I can  
> do it using
> "^[[:space:]]*[0-9]" but it also takes out lines w/o whitespace that  
> begin with
> numbers?


^[[:space:]]+[[:digit:]]+

will hit numbers with one or more digits.  to restrict the number of  
digits, use something like

^[[:space:]]+[[:digit:]]{2}[^[:digit:]]+

that, for example, should only hit lines that consist of at least one  
whitespace character, then exactly two digits, then at least one non- 
digit character.

-steve

--
If this were played upon a stage now, I could condemn it as an  
improbable fiction. - Fabian, Twelfth Night, III,v



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2209 bytes
Desc: not available
Url : http://lists.centos.org/pipermail/centos/attachments/20090105/32fcc77e/attachment.bin 


More information about the CentOS mailing list