from datetime import datetime


def get_first_timestamp(log_file, search_text):
    """Get the first timestamp of `search_text' in the log_file

    Args:
        log_file
        search_text (str)

    Returns:
        timestamp: datetime object
    """
    timestamp = None
    with open(log_file, "r") as f:
        content = [next(f) for x in range(51)]
    content = [x.strip().split() for x in content]

    for log_line in content:
        # Extract text
        text = ' '.join(log_line[3:-1])
        if search_text in text.lower():
            # Extract date for this text
            date_time_str = ' '.join(log_line[0:2])[1:-1]
            timestamp = datetime.strptime(date_time_str,
                                          '%Y-%m-%d %H:%M:%S.%f')
            break

    return timestamp