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.
- Save the file to a location accessible by the collector and make a note of the file path.
Step 2. Update user.properties
When a collector registers its sources, it reads the syncSources property from the user.properties configuration file to determine the file path of the source JSON file. The user.properties file is located in the collector's config folder.
|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.properties file located at <CollectorInstallationFolder>/config.
- 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 sourceSyncMode to "Json". For more information, see Collector API Methods and Examples. The following example shows the sourceSyncMode of a collector using UI mode.
Step 4. Restart the Collector
Restart the Collector for the changes to take effect.
To restart the Collector:
- Mac/Linux: sudo ./collector restart
- Windows: 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, the sources 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 collector 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.