import re


def get_tokens_in(line):
    """
    :param line: строка в формате 109.169.248.247 - - [12/Dec/2015:18:25:11 +0100] "GET /administrator/ HTTP/1.1" 200 4263 "-"
    :return: кортеж токенов  (ip, time, method, url, code, duration) или None
    """
    match = re.search(r"(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"
                      r".*:(\d{2}:\d{2}:\d{2})"
                      r".*(POST|GET|Get|get|PUT|DELETE|HEAD|Head|OPTIONS|T|PROPFIND|FOO|INDEX|SEARCH)"
                      r"\s+(.*)\s+HTTP/"
                      r".*\"\s+(\d{3})"
                      r"\s+(\d*)\s*", line)
    if match:
        return match.groups()