I'm trying to retrieve BigQuery audit logs using Stackdriver Logging Client Libraries in Python.
According to the tutorial, the following code should be able to fetch log entries:
for entry in client.list_entries():
do_something_with(entry)
However, this iterator just returns ProtobufEntry
and I couldn't find how to get the actual log message from this object.
for entry in client.list_entries():
print type(entry)
The above code produces the following output:
$ python log_test.py
<class 'google.cloud.logging.entries.ProtobufEntry'>
<class 'google.cloud.logging.entries.ProtobufEntry'>
<class 'google.cloud.logging.entries.ProtobufEntry'>
....
However, I couldn't find any way to parse those objects.
How can I parse actual log messages?