Google Cloud Logging: show lines around the matched lines
Asked Answered
M

2

15

Sometimes when searching logs by keyword or other conditions, I want to show not only the lines which match the condition, but also a few lines around them to better understand the context, similar to the -C flag of grep.

Is this possible?

Muster answered 1/10, 2020 at 19:50 Comment(0)
J
9

Also looking for this. What I found so far is the option to "Pin and show resource log entries" for a matched result. It will pin the entry, and then show it inline with the rest of the log

Pin options once you click the icon

Jae answered 1/3, 2022 at 11:4 Comment(0)
S
3

I do not think it is possible to achieve this on Google Cloud Logging.

I usually run a first query, get the timestamp of the log that I am interested in and then run a second query using Custom time range.

Advanced logs queries

Shebat answered 2/10, 2020 at 8:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.