GSPDQLLB200 DQL Practice Kubernetes Logs
GSPDQLLB200 DQL Practice Kubernetes Logs
Kubernetes Logs
Practice DQL - Labs
CONTENTS
1. Introduction ........................................................................................................................................3
1.1 Requirements .......................................................................................................................................................................... 3
1.2 Prerequisites ........................................................................................................................................................................... 3
2. Build a Query for Kubernetes Logs ....................................................................................................3
⚙ 2.1 Fetch and Display .............................................................................................................................................................. 3
⚙ 2.2 Filter for Kubernetes Logs .............................................................................................................................................. 3
⚙ 2.3 Add a Field for CloudProvider ....................................................................................................................................... 4
⚙ 2.4 Combine the Fields........................................................................................................................................................... 4
Appendix A: Answer Key ...........................................................................................................................5
2
1. Introduction
This lab will lead you through the creation of a DQL query that returns Kubernetes logs.
1.1 Requirements
You will need a GrailTM enabled Dynatrace environment where Kubernetes is monitored. Log Monitoring must
be enabled with logs ingested.
1.2 Prerequisites
You will need a general understanding of DQL basics. If you have not had experience creating DQL queries,
please review the DQL Basics course here.
3
⚙ 2.3 Add a Field for CloudProvider
1. Similar to 2.2, use the log.source to determine if the cloud provider is AWS (eks) or GCP (gke) and add
it as a field named "CloudProvider"
2. Remove the log.source field as CloudProvider will be displayed instead.
4
Appendix A: Answer Key
2.1 Fetch and Display
fetch logs, from:now() - 2h
| filter isNotNull(log.source)
| fields timestamp, log.source, content, loglevel
Then add:
| filter isNotNull(Kubernetes )