I would like to use wildcard in Google StackDriver Logging filter. However, according to the official website, filter can not use it. Is there any method I can use?
Asked
Active
Viewed 1.4k times
2 Answers
11
If you want to search for strings contained in text, just type that string directly.
Unicorn (text:Unicorn)
Finds all log entries containing unicorn, in any field and in any letter case.
If you want to add conditions in advanced filter to search in all pods that begin with "prefix", try like this (note ':' instead of '=')
:
resource.type="k8s_container"
resource.labels.cluster_name="cluster-1"
resource.labels.pod_name:"prefix"
Andrei Popa
- 111
- 1
- 3
3
You can check the following common basic search example:
Example:
A use of string like: uni* (text:uni*)
As explained in the above documentation "This is not a wildcard search. This search finds all log entries containing the 4-character string
"uni*"
. The Logs Viewer does not support regular expression searches and there are no special wildcard characters such as * or ?, in either the basic or advanced filter interfaces".
You may also submit this as a Feature Request using the Issue Trackers.