0

Using GCP router logs sink I would like to filter out some logs that are just spamming me.

In the past I did something like

jsonPayload.msg="GET /internal/prometheus [200 OK]"

which works fine but with textPayload it doesn't seem to have any effect. Currently the metrics and internal health checks are being printing in textPayload.

I have: textPayload=~"(.)200(.)OK"

Has anyone been able to filter logs based on textPayload before?

2
  • There's no reason why your filter would not work although it's unclear to me whether there's any value in the capture groups. I assume that you have log entries that match your filter. Please consider updating your question to include some examples of the log entries that you're trying to filter.
    – DazWilkin
    Commented Jul 10 at 15:32
  • In GCE and GKE custom logging labels prevent using from having a textPayload in this log entry, but you will have a jsonPayload with a "message" field Commented Jul 10 at 16:20

0

Browse other questions tagged or ask your own question.