Created
October 1, 2019 14:17
-
-
Save jeanbza/9293a2f74f0509c8dd32ba3d8e80ae09 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"cloud.google.com/go/logging/logadmin" | |
"google.golang.org/api/iterator" | |
) | |
func main() { | |
ctx := context.Background() | |
c, err := logadmin.NewClient(ctx, "projects/deklerk-sandbox") | |
if err != nil { | |
panic(err) | |
} | |
filter := `resource.type = "cloud_run_revision" | |
resource.labels.location = "us-central1" | |
logName: "run.googleapis.com%2Frequests" | |
` | |
it := c.Entries(ctx, logadmin.Filter(filter)) | |
for e, err := it.Next(); err != iterator.Done; { | |
if err != nil { | |
panic(err) | |
} | |
_ = e | |
} | |
fmt.Println("done") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment