Created
January 4, 2020 00:20
-
-
Save milesmatthias/cbf7b2656610a1c15630731c18d1cb5a to your computer and use it in GitHub Desktop.
Stackdriver UI to gcloud command
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
#!/usr/bin/env ruby | |
# HOWTO: | |
# 1. Copy your filters from the SD log UI | |
# 2. Run `pbpaste | ruby sd_to_gcloud.rb` | |
query=[] | |
ARGF.each_line do |line| | |
query.push line.gsub("\n", "").gsub("\"", "") | |
end | |
print "gcloud logging read \"#{query.join(" AND ")}\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment