By default, the Scalyr Agent will emit an agent.log file which is handy for monitoring the health and status of the agent, and the log file is relatively small. For those reasons we strongly encourage you to leave the Agent log enabled.
The agent periodically emits an agent_status
message which indicates the Agent version, so if you are curious which agent versions you are running, you can use the following PowerQuery:
| left join
a=($logfile == '/var/log/scalyr-agent-2/agent.log' "agent_status"
| parse from version '2.$agent_minor_version=digits$.$agent_patch_version=digits$'
| group count() by serverHost, version, agent_minor_version, agent_patch_version
| sort agent_minor_version, agent_patch_version
| columns serverHost, version),
b=($serverHost contains 'scalyr-agent-2'
| group count() by serverHost,k8s-cluster
| filter k8s-cluster=*
| sort k8s-cluster
| columns serverHost,k8s-cluster) on a.serverHost=b.serverHost
| columns serverHost, k8s-cluster, version
We are using a join for this query so that we can look up the Kubernetess cluster that is associated with the container in which the Scalyr Agent is running in Kubernetes. If you are not running Kubernetes, this query could be simplified to:
$logfile == '/var/log/scalyr-agent-2/agent.log' "agent_status" $version = *
| parse from version '2.$agent_minor_version=digits$.$agent_patch_version=digits$'
| group count() by serverHost, version, agent_minor_version, agent_patch_version
| sort agent_minor_version, agent_patch_version
| columns serverHost, version
Comments
0 comments
Please sign in to leave a comment.