Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2012
    Posts
    1

    Unanswered: Shell Script to Analyze Zimbra sync.log

    Hi All,
    Need to Analyze Zimbra sync.log file through Shell Script


    # Report Output Like that

    Total No of Mobile Device Used=..... (Samsung, Lg, Nokia,Htc, etc )
    No. of Mobile UserName=........ (Example user1, user2, usre3, )
    Types of SMART PHONE used= .......(Example : Android, window 7, iso4, )
    DeviceType=......

    or something like that..

    User Name : ..... Used Device Type :........ and it Device ID is : ...........


    Below is Sample of Zimbra sync.logs

    2009-12-16 00:00:43,970 INFO [btpool0-12194://webmail.amit.com/Microsoft-Server-ActiveSync?Cmd=Ping&User=rahul%40kke.amit.com&Devi ceId=androidc986729649&DeviceType=Android] [] sync - POST Microsoft-Server-ActiveSync?Cmd=Ping&User=ritesh%40kke.amit.com&Dev iceId=androidc986729649&DeviceType=Android

    2009-12-16 00:00:43,971 INFO [btpool0-12194://webmail.amit.com/Microsoft-Server-ActiveSync?Cmd=Ping&User=mohan%40kke.amit.com&Devi ceId=androidc986729649&DeviceType=Android] [] sync - DeviceID=androidc986729649; DeviceType=Android; UA=Android/0.3;
    Protocol=12.0; PolicyKey=null

    2009-12-16 00:00:43,971 INFO btpool0-12194://webmail.amit.comMicrosoft-Server-ActiveSync?Cmd=Ping&User=rahul%40kke.amit.com&Devi ceId=androidc986729649&DeviceType=Android]
    [name=rahul@kke.amit.com;mid=3041;Cmd=Ping;DeviceID =androidc986729649;Version=12.0;] sync - Response size 13 bytes

    2009-12-16 00:00:43,971 INFO [btpool0-12194://webmail.amit.com/Microsoft-Server-ActiveSync?Cmd=Ping&User=rahul%40kke.amit.com&Devi ceId=androidc986729649&DeviceType=Android]
    [name=rahul@kke.amit.com;mid=3041;Cmd=Ping;DeviceID =androidc986729649;Version=12.0;] sync - HTTP/1.1 200 OK

    2009-12-16 00:00:47,278 INFO [btpool0-12161://webmail.amit.com/Microsoft-Server-ActiveSync?Cmd=Ping&User=hotblast%40amit.com&Devic eId=Moxier359496033451946&DeviceType=MoxierAndroid] [] sync - POST Microsoft-Server-ActiveSync?Cmd=Ping&User=hotblast%40amit.com&Devic eId=Moxier359496033451946&DeviceType=MoxierAndroid

    Thanks in advance

    Amit

  2. #2
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    I am not doing all of it, but,
    Code:
    IFS="?"
    while read a b c
    do
    IFS="&"
    echo $b |read cmd user deviceid devicetyp
    IFS=" "
    echo $devicetyp |read devicetype rest
    IFS="&"
    echo $c |read cmd1 user1 deviceid1 devicetype2
    IFS=" "
    echo $cmd $user $deviceid devicetype
    echo $cmd1 $user1 $deviceid1 $devicetype2
    IFS="?"
    done
    This should reduce the line to a series of ordered pairs.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •