Difference between revisions of "Gcloud logging read"

From wikieduonline
Jump to navigation Jump to search
(Created page with "{{lc}} == See also == * {{gcloud logging}} Category:GCP")
 
 
(43 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
 +
<code>[[gcloud logging]] read</code>
 +
[[gcloud logging read --help]]
  
 +
* https://cloud.google.com/sdk/gcloud/reference/logging/read
 +
 +
[[--freshness]] 90d
 +
 +
resource.labels.container_name=""
 +
                .pod_name=""
 +
                .[[gcloud logging read resource.labels.cluster_name|cluster_name]]=""
 +
 +
resource.type=K8s_container=""
 +
 +
resource.labels.[[k8s_node]]=""
 +
 +
 +
 +
gcloud logging read "[[resource.labels.container_name]]=YourContainerName"
 +
gcloud logging read "[[resource.labels.pod_name]]=YourPodsName"
 +
 +
container.name
 +
:<code>gcloud logging read "resource.labels.container_name=[[elasticsearch]]"</code>
 +
 +
pod.name
 +
gcloud logging read "resource.labels.pod_name=[[elasticsearch-master-0]]"
 +
gcloud logging read "resource.labels.pod_name=elasticsearch-master-0 OR resource.labels.pod_name=elasticsearch-master-1"
 +
 +
 +
gcloud logging read "[[resource.type]]=k8s_container AND [[resource.labels.container_name]]=YourContainerName"
 +
 +
[[gcloud logging]] read "resource.labels.container_name=backup" | grep [[textPayload]]
 +
 +
[[gcloud logging read projects/your-project/logs/kubelet]]
 +
 +
[[gcloud logging logs list]]
 +
 +
 +
{{gloud logging logs list kubernetes}}
 +
 +
== Errors ==
 +
[[gcloud logging]] read "resource.type=global"
 +
ERROR: (gcloud.logging.read) PERMISSION_DENIED: The caller does not have permission
 +
[[helm get all]]
 +
 +
gcloud logging read "resource.labels.[[k8s_node]]=gke-gitlab-runner-cluster-pool-1-3534-4"
 +
ERROR: (gcloud.logging.read) INVALID_ARGUMENT: Request contains an invalid argument.
 +
 +
== Related ==
 +
* <code>[[kubectl get events]]</code>
 +
* [[GCP log explorer]]
 +
* <code>[[resource.labels.container_name]]</code>
 +
* <code>textPayload=~".*your-text-to-be-included.*"</code>
 +
* <code>[[gcloud app logs read]]</code>
  
 
== See also ==
 
== See also ==
 
* {{gcloud logging}}
 
* {{gcloud logging}}
 
  
 
[[Category:GCP]]
 
[[Category:GCP]]

Latest revision as of 17:03, 29 November 2022

gcloud logging read

gcloud logging read --help
--freshness 90d
resource.labels.container_name=""
               .pod_name=""
               .cluster_name=""
resource.type=K8s_container=""
resource.labels.k8s_node=""


gcloud logging read "resource.labels.container_name=YourContainerName"
gcloud logging read "resource.labels.pod_name=YourPodsName"

container.name

gcloud logging read "resource.labels.container_name=elasticsearch"

pod.name

gcloud logging read "resource.labels.pod_name=elasticsearch-master-0"
gcloud logging read "resource.labels.pod_name=elasticsearch-master-0 OR resource.labels.pod_name=elasticsearch-master-1"


gcloud logging read "resource.type=k8s_container AND resource.labels.container_name=YourContainerName"
gcloud logging read "resource.labels.container_name=backup" | grep textPayload
gcloud logging read projects/your-project/logs/kubelet
gcloud logging logs list


gcloud logging logs list | grep kube
projects/your-project/logs/kube-container-runtime-monitor
projects/your-project/logs/kube-node-configuration
projects/your-project/logs/kube-node-installation
projects/your-project/logs/kube-proxy
projects/your-project/logs/kubelet
projects/your-project/logs/kubelet-monitor

Errors[edit]

gcloud logging read "resource.type=global"
ERROR: (gcloud.logging.read) PERMISSION_DENIED: The caller does not have permission
helm get all
gcloud logging read "resource.labels.k8s_node=gke-gitlab-runner-cluster-pool-1-3534-4"

ERROR: (gcloud.logging.read) INVALID_ARGUMENT: Request contains an invalid argument.

Related[edit]

See also[edit]

Advertising: