Afficher un message
Vieux 24/03/2008, 20h22   #2
Cyrus Kriticos
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Parse a syslog to get the size

explor wrote:
>
> I've a syslog with thousands of entries as listed below. I need to get
> the size for each message. I can do this by awk like:
>
> grep "size=" /var/log/syslog | grep "stat=Delivered" | awk '{print
> $13}'
>
> but the issue here is, if the mailbox= paramater doesn't a space in it
> will work fine but if it does, then awk '{print $13}' fails to grab
> the size= parameter.


replace

awk '{print $13}'

with

sed "s/.*\(size=[0-9]*\).*/\1/"

--
Best regards | Monica Lewinsky's X-Boyfriend's
Cyrus | Wife for President
  Réponse avec citation
 
Page generated in 0,04277 seconds with 9 queries