You can spread your agent configuration across multiple files that we refer to as "snippets". This is convenient when using automated tools to manage your servers.
For instance, you could write a script that installs a product and also installs a Scalyr Agent to gather logs from that product. Your script can conveniently generate modular config snippets without having to parse and modify the main agent config file (or other modular snippets).
Modular snippets are stored in a special directory:
/etc/scalyr-agent-2/agent.d on Linux and
C:\\Program Files (x86)\scalyr\config\agent.d\in Windows
All files in this directory that end in .json are read by the agent and applied to the agent's configuration.
Modular snippets may also contain global configuration variables (e.g. api_key). However, a given global variable cannot be defined in more than 1 file. (The agent will terminate with an error message if a variable is defined in multiple locations.)
The agent automatically detects new, modified, or deleted snippets in the agent.d directory; you don't need to restart it.
Please sign in to leave a comment.