One of the key features of the Scalyr Agent is its ability to watch a log file for new lines and upload those lines to DataSet Event Data Cloud.
Log files are configured in the logs
stanza in the agent.json
Linux
cat /etc/scalyr-agent-2/agent.json
{
// Enter a "Write Logs" api key for your account. These are available at https://www.scalyr.com/keys
api_key: "API-KEY-HERE",
server_attributes: {
serverHost: "app-server-3",
},
// Log files to upload to Scalyr. You can use '*' wildcards here.
logs: [
{ path: "/tmp/log", attributes: {parser: "accessLog"} },
{ path: "/var/log/*.log", attributes: {parser: "custom_parser"} }
],
monitors: [
]
}
or in a standalone file in the modular agent.d directory.
cat /etc/scalyr-agent-2/agent.d/logs.json
logs: [
{ path: "/tmp/log", attributes: {parser: "accessLog"} },
{ path: "/var/log/*.log", attributes: {parser: "custom_parser"} }
],
Windows
Config is located here. It is important to open as admin
C:\Program Files (x86)\Scalyr\config\agent.json
{
// Enter a "Write Logs" api key for your account. These are available at https://www.scalyr.com/keys
api_key: "API-KEY-HERE",
server_attributes: {
serverHost: "server-3",
},
// Log files to upload to Scalyr. You can use '*' wildcards here.
logs: [ { path: "C:\\WebServer\\logs\\access.log", attributes: {parser: "accessLog"} } ]
monitors: [ { module: "scalyr_agent.builtin_monitors.windows_event_log_monitor", channels: [ { "channel": [ "Application", "Security", "System" ], "query": "*[System/Level=0 or System/Level=1 or System/Level=2 or System/Level=3 or System/Level=4]" } ] } ]
}
Comments
0 comments
Please sign in to leave a comment.