Excercise
In this exercise, we will take our existing cluster, assign the frontend a parser, and configure this parser in DataSet.
- get deployments
-
kubectl get deployments
-
- find the frontend deployment or a deployment in your environment
-
- Apply a pod annotation to this deployment. This can be done in one of two ways.
- CLI
-
kubectl annotate pod <pod-name> --overwrite log.config.scalyr.com/attributes.parser=custom-parser
-
- YAML
-
metadata:annotations:
"log.config.scalyr.com/attributes.parser": "custom-parser"
-
- CLI
- For this example, we want this to apply dynamically to all pods, not just a single pod, so we will change this in the manifest.
- Looking at our logs from these containers, we can see that they are json logs, so we will define the "json" parser
- Update the manifest for "frontend"
-
kubectl edit deployment frontend
-
- Add the following to the pod annotation section. (Further documentation on where that is here)
- "log.config.scalyr.com/attributes.parser": "custom-parser"
- Apply a pod annotation to this deployment. This can be done in one of two ways.
-
- check the rolling update status
- View logs in scalyr and check the parser
- As we can see the parser json was a "scalyr" default and handled the json objects easily since the objects are broken into columns properly.
Comments
0 comments
Please sign in to leave a comment.