Search code examples
stackdriver

Is there a way to view surrounding logs in Stackdriver Logs Viewer?


Stackdriver logs search is great for finding particular logs one might be interested in, but then it's a bit annoying to zoom out and look at nearby logs e.g. what was happening around that time, especially if a lot of logs were generated on/near the same timestamp. Kibana has a feature for being able to see nearby docs[1] and apply/takeaway filters, is there a way to do this in Stackdriver?

[1] https://youtu.be/sNGbxbCv-6I


Solution

  • There are some basic filters available in Stackdriver which may not exactly what you see in Kibana but would serve your purpose. You can use the time-range selector drop-down menu to filter specific date and time in the logs. Once you identify a specific log, you can set time to see logs before and after using the "custom" field of time range selector.

    Alternatively, you can set "Jump to time" field from the time-range selector field and then set time for specific log and then you could use another drop-down menu next to the time-range selector from where you can select time ranges (Eg. +/-1 Hour, +/-6 hours etc).