Rexp_coordsys = r"(^.+&\wRS=(?P.*?))" # search for the coordinate system between the string '&SRS=' or '&CRS=' and a ampersand '&' and give it the key 'koordsys' Rexp_name = r"(^.+/bios/wms/app/(?P.+?)\?)" # search for the name of the called WMS-service (are between the string '/bios/wms/app/' and a '?') and give it the key 'name'to the FIRST occurrence of "?", "+?" makes the "+" non-greedy The regex I am using is: rexp_ip = r"(?P(\d)" # search for the timestamp XX:XX:XX and give it the key 'tid' What I am trying to do is to extract the IP address for all lines with a string REQUEST=GetMap. I will post the two questions separately to not confuse you. I got kind of far but I got stuck with two questions that me and my colleague could not figure out why they were giving us such headache. ![]() ![]() I'm quite new to python and I'm trying to (using python 3) go through a number of large custom log files to extract parameters from certain GET requests an try to collect some statistics from them.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |