Upload Multiple Log Files

This Solution describes how to upload multiple log files from a single server, such as a web access log, the system log, and an application debugging/error log.

A Solution is a step-by-step guide for accomplishing a specific task, designed to make sense even if you're just getting started with Scalyr server monitoring. If you're new to Scalyr, you should read the short Getting Started guide. For help with other tasks, see the Solutions directory.

Steps

1. Log into the server from which you would like to upload logs, and open the file agent.json.

2. Find the logs section of the file. It may look something like this:

logs: [
   {
     path: "/var/log/httpd/access*",
     attributes: {parser: "accessLog"}
   }
 ]

3. Add a stanza for each additional file you'd like to monitor. For instance:

logs: [
   {
     path: "/var/log/httpd/access*",
     attributes: {parser: "accessLog"}
   },
   {
     path: "/var/log/messages",
     attributes: {parser: "system-messages"}
   },
   {
     path: "/var/log/my-application/debug.log",
     attributes: {parser: "app-debug"}
   }
 ]

4. After 60 seconds, click Overview in the navigation bar. Check to see that your new logs have appeared. If not, double-check your changes to the agent configuration file, and then try the agent troubleshooting reference.

Note that the Scalyr Agent will not generally upload old log messages. The log files won't appear on the Overview page until fresh data is written to the log.

Further Reading

To get the most use out of your log files, you should set up parsing rules. The Scalyr team can take care of this for you. See the instructions at the top of the Log Parsing reference.

To learn more about configuring the Scalyr Agent, see the Agent reference. You can add additional fields to each log to distinguish between logs from different services; prevent noisy or sensitive log messages from being uploaded; and more.