Extract string from log file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • josephtys86@googlemail.com

    Extract string from log file

    203.114.10.66 - - [01/Aug/2008:05:41:21 +0300] "GET /stat.gif?
    stat=v&c=F-Secure&v=1.1%20 Build%2014231&s =av%7BNorton
    %20360%20%28Sym antec%20Corpora tion%29+69%3B%7 Dsw%7BNorton
    %20360%20%28Sym antec%20Corpora tion%29+69%3B%7 Dfw%7BNorton
    %20360%20%28Sym antec%20Corpora tion%29+5%3B%7D v%7BMicrosoft%2 0Windows
    %20XP+insecure% 3BMicrosoft%20W indows%20XP%20P rofessional+f
    %3B26027%3B2644 7%3B26003%3B224 52%3B%7D&r=0.94 96 HTTP/1.1" 200 43
    "http://dfstage1.f-secure.com/fshc/1.1/release/devbw/1.1.14231/
    card.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
    SV1; .NET CLR 2.0.50727)"



    does anyone know how can i extract certain string from this log file
    using regular expression in python or using XML. can teach me.
  • Larry Bates

    #2
    Re: Extract string from log file

    josephtys86@goo glemail.com wrote:
    203.114.10.66 - - [01/Aug/2008:05:41:21 +0300] "GET /stat.gif?
    stat=v&c=F-Secure&v=1.1%20 Build%2014231&s =av%7BNorton
    %20360%20%28Sym antec%20Corpora tion%29+69%3B%7 Dsw%7BNorton
    %20360%20%28Sym antec%20Corpora tion%29+69%3B%7 Dfw%7BNorton
    %20360%20%28Sym antec%20Corpora tion%29+5%3B%7D v%7BMicrosoft%2 0Windows
    %20XP+insecure% 3BMicrosoft%20W indows%20XP%20P rofessional+f
    %3B26027%3B2644 7%3B26003%3B224 52%3B%7D&r=0.94 96 HTTP/1.1" 200 43
    "http://dfstage1.f-secure.com/fshc/1.1/release/devbw/1.1.14231/
    card.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
    SV1; .NET CLR 2.0.50727)"
    >
    >
    >
    does anyone know how can i extract certain string from this log file
    using regular expression in python or using XML. can teach me.
    Joseph,

    You will get much more help on this list if you show us what you have actually
    tried so far to solve the problem on your own. Then post what is not working
    (with full tracebacks if there are any) and you will find that people will try
    to assist you. If you require help reading lines from a file or learning
    regular expressions, you really need to use Google to look for tutorials first.

    -Larry

    Comment

    Working...