title: How to parse audit log entries from Stackdriver on GCP
body: <p>I'm trying to retrieve BigQuery audit logs using <a href="https://cloud.google.com/logging/docs/reference/libraries?hl=ja#client-libraries-usage-python" rel="nofollow noreferrer">Stackdriver Logging Client Libraries</a> in Python.</p>
  
  <p>According to <a href="https://googlecloudplatform.github.io/google-cloud-python/latest/logging/usage.html" rel="nofollow noreferrer">the tutorial</a>, the following code should be able to fetch log entries:</p>
  
  <pre><code>for entry in client.list_entries():
      do_something_with(entry)
  </code></pre>
  
  <p>However, this iterator just returns <code>ProtobufEntry</code> and I couldn't find how to get the actual log message from this object.</p>
  
  <pre><code>for entry in client.list_entries():
      print type(entry)
  </code></pre>
  
  <p>The above code produces the following output:</p>
  
  <pre><code>$ python log_test.py
  &lt;class 'google.cloud.logging.entries.ProtobufEntry'&gt;
  &lt;class 'google.cloud.logging.entries.ProtobufEntry'&gt;
  &lt;class 'google.cloud.logging.entries.ProtobufEntry'&gt;
  ....
  </code></pre>
  
  <p>However, I couldn't find any way to parse those objects.</p>
  
  <p>How can I parse actual log messages?</p>