Sumologic agents can collect log data from various sources, including local files, remote files, system events, and custom scripts.
The custom script log is a powerful tool that lets you write a script or program, capture its output, and send it over to the Sumologic collector.
An example is a program or script that connects to an internal application, retrieves its status, and sends it over to Sumologic.
Things to know when using this script logging:
- If you run a shell command or a batch file, do not assume that its path is set, or that it has access to the enviromental variables you have as an online user. Explicitly set the path or any custom variables your script needs.
- The Sumologic agent captures both stdout and stderr. This means that any and all messages your script is likely to throw to the screen, will be captured by Sumologic. If you don't want that, suppress the messages you don't need, for example by redirecting stderr to /dev/null (NUL in windows).
- * Set timeout on the collector source only if the script must be allowed to end before the next instance is executed.
Happy Sumo logging...