How can we see logs just after and before particular text in Google Cloud Logging?

Viewed 1212

In Google Cloud Logging, using advanced search Can we search for a text and then see logs present after and before that particular text?

Like for example in a PDF, doc or any file when you search for a word then after searching that word you can see content just above and below of the searched text, but in google cloud logging we can only see texts where words are present, but not the content present just above and below it.

Can anyone please tell me is it possible to search just above and below logs present in Google Cloud Logging or not?

2 Answers

There's no built in feature in Google Cloud Logging like the one you are describing.

However, what you can do with advanced filters is searching by time. This way you can search for a text and then, based on the timestampof that log, search with timeframe filter.

For example, the text log has a timestamp of 2016-11-29T23:00:00Z. Now you can search for it's context with a filter that has an upper and lower time limit from that timestamp, like this one:

timestamp >= "2016-11-29T22:55:00Z"
timestamp <= "2016-11-29T23:05:00Z"

If this workaround is not enough, then feel free to create a new feature request in Google's Issue Tracker explaining in more detail the kind of feature you would want to see introduced in Google Cloud Logging.

Related