When searching kubernetes logs I can add a bit of context to my search using the below command, which will return the logs matching my keyword as well as the 3 logs preceding and following any log matching keyword

Kubectl logs mypod | grep “mykeyword” -A3 -B3

Given a google logging query like the below where I use textPayload to search for my keyword, How to add a bit of context my search (i.e., returning as well the few preceding and following logs)?

resource.type="k8s_container"
resource.labels.project_id="myproject"
resource.labels.location="europe-west1-d"
resource.labels.cluster_name="mycluster"
resource.labels.namespace_name="mynamespace"
resource.labels.pod_name="mypod"
resource.labels.container_name="mycontainer"
textPayload: "mykeyword"
0

There are 0 best solutions below