How to parse AWS Redshift User Activity Log into an object?
<p>I am trying to parse AWS Redshift User Activity Log (<a href="http://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html" rel="nofollow noreferrer">http://docs.aws.amazon.com/redshift/latest/mgmt/db-auditing.html</a>) into an object.</p>

<p><strong>Redshift User Activity Log</strong></p>

<pre><code>'2016-11-16T08:00:13Z UTC [ db=dev user=rdsdb pid=30500 userid=1 xid=1520 ]' LOG: SELECT 1
</code></pre>

<p><strong>Python RedshiftUserActivityLog object</strong></p>

<pre><code>class RedshiftUserActivtyLog (object):    
        def __init__(self, record_time, db,
                 user, pid, user_id, xid,
                 query):
        super(RedshiftUserActivtyLog , self).__init__()

        self.record_time = record_time
        self.db = db
        self.user = user
        self.pid = pid
        self.user_id = user_id
        self.xid = xid
        self.query = query
</code></pre>

<p>My current solution is to remove the unnecessary characters like '[, ], UTC, LOG, :', split the log by space into a list. After that, convert the list into the object.</p>

<p>Can anyone suggest me the better way to do this task?    </p>