Collector Scripted Installation - Sources?
I'm brand new to SumoLogic and couldn't find the answer to my question after doing a few searches here.
I'm trying to script installation of the Collector agent for Windows, and I can't seem to get the sources aspect correct.
The command line instructions say to use:
SumoCollector_windows-x64_19_253-14.exe -console -q "-Vsumo.accessid=xxxxx" "-Vsumo.accesskey=xxmorexxxx" "-Vsources=filepath"
The problem I have is with the -Vsources switch. I created a JSON file and put it in the directory where I ran the installer exe, but it gave the error that the file wasn't in the Program Files/Sumo Logic COllector/ directory.
Since that directory gets created during the setup, I wasn't sure how to get the json file's there, so in the command like for -vsources, I referenced the location of the json file directly. However, it didn't actually create the sources in the Dashboard. It only added the collectior and the configuration files user.properties still reference the actual initial location of the json file.
I thought that creating this json file and using it during installation would cause the installer to create the sources during installation, but that doesn't seem to work. How do I create an installer script that will create the desired sources during the installation correctly?
-
Hi Steven,
Few initial things to check.1.) Make sure your JSON file is UTF-8 encoded. The Collector may not recognize the file if it's in another encoding (Windows likes to use UTF-16)
3.) The supplied JSON is in a valid JSON format required.
2.) The path supplied in the -Vsources or -VsyncSources need to be escaped with double backslashes on Windows. So, for example, the path may need to be set as the following in your install command:-Vsources=C:\\Program Files\\Sumo Logic Collector\\sources.json
Note: The -Vsources command is only used to create the Sources at the time of the initial install/registration of the Collector. Adding this file after the Collector is registered will have no effect. If you want to use the JSON file to manage Sources after install time you will have needed to use the -VsyncSources parameter at the time of the install OR you will need to change the parameter name in your user.properties to "syncSources=" and set the Collector to File Managed mode (setting under the Collector config in the UI) and then restart the Collector.
There are some additional troubleshooting steps in the following KB and hopefully one of these will help.
https://support.sumologic.com/hc/en-us/articles/360012911033-Collector-source-configuration-not-getting-updated-per-syncSources-json-config-file
Please sign in to leave a comment.
Comments
4 comments