I am having an issue finding logs from the google-cloud-logging ruby gem.
I can find these logs through my google cloud console with the advanced search: jsonPayload.requestId=875325619
Which returns multiple results, one basic example:
{
insertId: "epfh5dffj67k5"
jsonPayload: {
requestId: 875325619
request: {…}
timeSeconds: 5.296060973778367
}
resource: {
type: "gce_instance"
labels: {…}
}
timestamp: "2017-05-08T19:31:20.145488859Z"
severity: "WARNING"
logName: "projects/myproject/logs/mylog"
}
However through the ruby agent this returns an empty array:
logging = Google::Cloud::Logging.new
logging.entries filter: "jsonPayload.requestId=875325619"
=> []
However looking for a different log message I send works:
logging.entries filter: 'jsonPayload.uploadKey="example"'
[#<Google::Cloud::Logging::Entry:0x00000008e6ea30 (data here)>]
That data looks like this:
{
insertId: "8w81fbg2a077zl"
jsonPayload: {
processingTime: 0.79228602
uploadType: "type"
uploadKey: "example"
}
resource: {
type: "gce_instance"
labels: {…}
}
timestamp: "2017-05-08T18:58:11Z"
labels: {…}
logName: "projects/myproject/logs/otherapp"
}
Why can I find one set of log messages and not the other?