By default the agent requires one configuration option. This is the api_key. As you noticed in the install, you can assign this with a flag when you run the install script.
Further configuration can be done within the agent.json
file. At a minimum, you will want to specify one or more logfile paths, which the agent will then stream to DataSet- more details here.. You may also provide additional metadata like tier: "production"
- these will come through to DataSet as Server Fields and provide your users with additional search and filtering options - more details here.
The main agent config location is located here
cd /etc/scalyr-agent-2/
Here is an example configuration file.
vim agent.json
{
// Enter a "Write Logs" api key for your account. These are available at https://www.scalyr.com/keys
api_key: "KEY_HERE",
// Fields describing this server. These fields are attached to each log message, and
// can be used to filter data from a particular server or group of servers.
server_attributes: {
// Fill in this field if you'd like to override the server's hostname.
serverHost: "REPLACE THIS",
// You can add whatever additional fields you'd like.
// tier: "production"
}
// Log files to upload to Scalyr. You can use '*' wildcards here.
logs: [
{ path: "/tmp/log", attributes: {parser: "accessLog"} }
],
monitors: [
{
module: "scalyr_agent.builtin_monitors.mysql_monitor",
database_socket: "default",
database_username: "USERNAME",
database_password: "PASSWORD"
}
]
}
Comments
0 comments
Please sign in to leave a comment.