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
|