With local configuration file management, all configuration is done through a configuration file. This approach allows you to create scripts to configure multiple Collectors and Sources or to create configuration backups.
Step 1. Get a configuration file
The Sumo web application can generate ready-to-use JSON for the Sources that are already configured for the Collector. For additional details, see View or Download Collector or Source JSON Configuration.
To get the JSON configuration and create a configuration file
- In the Sumo web app select Manage Data > Collection > Collection.
- Select the information icon to the right of the Collector or Source.
- Copy and paste the displayed JSON into a new text file. Name the text file
sources.json, or any other name that makes sense. The file must have a
- Save the file to a location accessible by the Collector and make a note of the file path.
For more information on the configuration file see Options for Specifying Sources in Local Configuration Files.
Step 2. Update user.properties
When a Collector starts it reads the
syncSources parameter from the
user.properties configuration file to determine the file path of the JSON file or folder with the Source configurations. The
user.properties file is located in the Collector's
|syncSources||String||Sets the JSON file describing sources to configure on registration, which will be continuously monitored and synchronized with the Collector's configuration.|
To add the syncSources parameter
- Open or create the
user.propertiesfile located at
- Add the following:
On Windows systems, use a double-backslash for the file path:
- Save and close the file.
Step 3. Make the switch
You can now move to the local configuration file management option, using the Sumo web application or the Collector Management API.
Do one of the following:
- In the Sumo web app, choose Local Configuration File in the Edit Collector dialog box.
- In the Collector Management API, use the PUT method to update the Collector's
Json". For more information, see Collector API Methods and Examples. The following example shows the
sourceSyncModeof a Collector using UI mode:
Step 4. Restart the Collector
Restart the Collector for the changes to take effect.
To restart the Collector:
sudo ./collector restart
net restart sumo-collector
Step 5. Verify the Sources are configured properly
Examine the Collector log file to verify that the Collector is ingesting data from all Sources.
Editing the configuration file
You can edit the JSON configuration file at any time to edit Source attributes or add new Sources. When you delete Sources from the file they are deleted from the Collector.
After you finalize changes to the
sources.json file, test the changes by deploying this configuration file to a Collector on a host that is NOT in production. After the file is validated, deploy the file to each host with Sources that need to be modified by overwriting the existing
sources.json file. Collectors continually watch for updates to the
sources.json file for changes. Any edits are immediately processed.