Note: Team accounts are only available to paid customers with an annual agreement.
Starting from Scalyr Agent v2.1.15
supports multiple API keys in a single agent configuration. This feature enables log ingestion to multiple DataSet team accounts, so the more targeted logs could be consumed by the corresponding teams.
For example, technical information such as stack trace logs is sent to the engineering team account, while the explanation of the exception is forwarded to the support team's account. This allows the support team to easily find and identify the issue, so the customers can be notified and resolved the problem in time.
Here is a quick sample agent config file with two API keys:
{
"use_multiprocess_workers":true,
"default_sessions_per_worker":3,
"workers":[
{
"api_key":"XXXXXXXXX5KI-",
"id":"dev"
}
]
api_key: "XXXXXXXXX3tA-",
debug_level: 5,
server_attributes: {
serverHost: "wei-centos",
tier: "production"
}
// Log files to upload to Scalyr. You can use '*' wildcards here.
logs: [
{
path: "/var/log/scalyr-agent-2/agent_debug.log",
attributes: {parser: "dev"},
worker_id: "dev"
},
{
path: "/home/centos/scalyr-support/render.log",
attributes: {parser: "support"}
}
],
monitors: [
]
}
The API key that ends with 5KI-
is for the dev team and the default API key is for the support team which will be used for all log files without an explicit key id.
The last thing to do is to associate the API keys with the corresponding log files by adding "worker_id". Now, we're ready to start the agent and run scalyr-agent-2
status -v
to verify the API keys are applied correctly.
....
Log transmission:
=================
(these statistics cover the period from Mon Sep 5 10:18:01 2022 UTC)
Total bytes uploaded: 26059
Overall health check: Good
Uploads statistics by worker:
Worker default:
Session default-0:
Bytes uploaded successfully: 5543
Last successful communication with Scalyr: Mon Sep 5 10:18:43 2022 UTC
Last attempt: Mon Sep 5 10:18:43 2022 UTC
Last copy request size: 759
Last copy response size: 37
Last copy response status: success
Health check: Good
Session default-1:
Bytes uploaded successfully: 7819
Last successful communication with Scalyr: Mon Sep 5 10:18:43 2022 UTC
Last attempt: Mon Sep 5 10:18:43 2022 UTC
Last copy request size: 552
Last copy response size: 37
Last copy response status: success
Health check: Good
Session default-2:
Bytes uploaded successfully: 7088
Last successful communication with Scalyr: Mon Sep 5 10:18:43 2022 UTC
Last attempt: Mon Sep 5 10:18:43 2022 UTC
Last copy request size: 213
Last copy response size: 37
Last copy response status: success
Health check: Good
Log files associated with workers:
Worker default:
Session default-0:
/home/centos/scalyr-support/render.log
/var/log/scalyr-agent-2/agent-worker-session-default-0.log
/var/log/scalyr-agent-2/agent-worker-session-dev-0.log
Session default-1:
/var/log/scalyr-agent-2/agent_debug.log
/var/log/scalyr-agent-2/agent-worker-session-default-1.log
/var/log/scalyr-agent-2/agent-worker-session-dev-1.log
Session default-2:
/var/log/scalyr-agent-2/agent.log
/var/log/scalyr-agent-2/agent-worker-session-default-2.log
/var/log/scalyr-agent-2/agent-worker-session-dev-2.log
Path /home/centos/scalyr-support/render.log: copied 4000 bytes (160 lines), 0 bytes pending, last checked Mon Sep 5 10:18:48 2022 UTC
Path /var/log/scalyr-agent-2/agent_debug.log: copied 15931 bytes (111 lines), 0 bytes pending, last checked Mon Sep 5 10:18:48 2022 UTC
Path /var/log/scalyr-agent-2/agent.log: copied 21698 bytes (55 lines), 0 bytes pending, last checked Mon Sep 5 10:18:48 2022 UTC
Glob: /var/log/scalyr-agent-2/agent-worker-session-*.log:: last scanned for glob matches at Mon Sep 5 10:18:02 2022 UTC
/var/log/scalyr-agent-2/agent-worker-session-default-0.log: copied 657 bytes (5 lines), 0 bytes pending, last checked Mon Sep 5 10:18:48 2022 UTC
/var/log/scalyr-agent-2/agent-worker-session-default-1.log: copied 657 bytes (5 lines), 0 bytes pending, last checked Mon Sep 5 10:18:48 2022 UTC
/var/log/scalyr-agent-2/agent-worker-session-default-2.log: copied 657 bytes (5 lines), 0 bytes pending, last checked Mon Sep 5 10:18:48 2022 UTC
/var/log/scalyr-agent-2/agent-worker-session-dev-0.log: copied 653 bytes (5 lines), 0 bytes pending, last checked Mon Sep 5 10:18:48 2022 UTC
/var/log/scalyr-agent-2/agent-worker-session-dev-1.log: copied 653 bytes (5 lines), 0 bytes pending, last checked Mon Sep 5 10:18:48 2022 UTC
/var/log/scalyr-agent-2/agent-worker-session-dev-2.log: copied 653 bytes (5 lines), 0 bytes pending, last checked Mon Sep 5 10:18:48 2022 UTC
Scalyr Agent is now ready to collect logs and send the logs to both accounts.
Comments
0 comments
Please sign in to leave a comment.