Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stackdriver advanced filter query without wildcards

I have logs being sent in JSON format to Stackdriver, each which contains an entry like:

name: pipeline.<application>.process

where <application> is a variable length string that represents various components in our system.

I would like a query to get all such logs, however, don't know how to do so given that stackdriver doesn't support wildcards or regex.

Ideally, something like a pipeline.*.process would be great, but I can't figure it out from the docs. Equally, <application> takes >40 forms, and so I don't want to create a custom metric for every one.

like image 400
unstarreren8271 Avatar asked Aug 07 '26 08:08

unstarreren8271


1 Answers

Filtering for

jsonPayload.name: "pipeline."
jsonPayload.name: ".process"

should give you the results you want

If you're interested in building a metric you can create a single log based metric that extracts the portion of the name value: https://cloud.google.com/logging/docs/logs-based-metrics/labels

like image 167
Kirk Kelsey Avatar answered Aug 09 '26 12:08

Kirk Kelsey