Re: how to separate individual logs?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Please unsubscribe the side on my email

-----Original Message-----
From: centos-bounces@xxxxxxxxxx [mailto:centos-bounces@xxxxxxxxxx] On Behalf
Of John Doe
Sent: 29 November 2010 16:50
To: CentOS mailing list
Subject: Re:  how to separate individual logs?

From: hadi motamedi <motamedi24@xxxxxxxxx>

> I have captured a file  in my centos showing logs captured from  many
> modules concurrently. Please find attached a sample of the file.  As
> you see, there are logs from individual modules that have been
> captured  concurrently. For example, there are logs from
> IPTR,SNMP,HLR,TCAP,XAPP,and  SCCP modules but they are coming
> concurrently.Each log has the header name of  its accompanied module in
> the beginning. I need to have the log of each  modules separately. Can
> you please show me the power of centos on how to  separate individual
> module's logs from the whole?

Here is "The Power of CentOS"!!!  (in approximately 3 minutes...)

cat edit.txt | while read LINE; do
  echo "$LINE" | grep -q '>\.\.'
  if [ $? -eq 0 ]; then
    LOGFILE=`echo $LINE | cut -d' ' -f1`.log
  else
    echo "$LINE" >> $LOGFILE
  fi
done

JD

PS: I wonder if I am doing your school homework...


      
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux