-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging: parse entries created by bigquery_resource #5313
Comments
@yiga2 We don't have any visibility here as to what kind of message has been passed by the originator as the |
EDITED - replaced and in filter with AND as it's case-sensitive. Note that a line-feed or space between filter entries works too. Understood.
then here to retrieve the log entries (I am project owner)
|
@yiga2 I've found the docs for the |
@yiga2 If you know / expect that the log entry contains an from google..... import AuditLog # I don't know the path of the proto-generated module
def unmarshall_audit_log(entry):
if entry.payload_pb.Is(AuditLog.DESCRIPTOR):
message = AuditLog()
protobuf_entry.parse_message(message)
return message |
Not sure why it gets closed as what seems to be missing is the module compiled from proto, as per https://stackoverflow.com/questions/50301632/using-python-to-query-gcp-stackdriver-logs Instead of each of us compiling a python module for it, it would make sense to have a new google.cloud.audit package containing, at a minimum, the AuditLog module. After that, I agree @tseaver's code makes it straightforward to parse. |
as a fully fleshed out example, here's how i generated my own @yiga2 is right, though, Google should ideally maintain official versions of these Python protobuf bindings instead. |
client_logging.list_entries()
on BigQuery log entries renders a list ofProtobufEntry
objects.Unfortunately there is no documentation on how to read ("unpack" ?) the
payload_pb
property, for instance to retrieve thejobId
.Request to extent the documentation beyond retrieving entries that were written to a logger, and include snippets on how-to parse
protoPayload
messages like those created by GCP services.The text was updated successfully, but these errors were encountered: