When installing a Sumo Logic collector, you have 2 methods of configuration:
You can continue to configure the collector via the web interface
Easy to do and many options are just a click or drop-down away
You can continue to configure the collector via an installed JSON file
Full control of the configuration, version control, and the ability to use an automation system like Ansible to handle standardized/consistent deployment
But you cannot do both.
There are not a lot of good examples that I have found for configuring the collector via the JSON method and a few options available. For this blog post I am going to use one of my collectors’ configuration files (sumologic-collector.json) and break down things a bit to help out the community.
But before we dive into the JSON file let’s take a quick look at the sumo.conf file (no, these are not my real access credentials for registering a collector):
the hostname of the system, and will default to the local hostname if available
email address associated with a Sumo Logic account, and used if you decide to use the authentication version of registration instead of the accessid/accesskey way
self-explanatory and you generate these credentials via the web interface for collectors
where the JSON file is read from
Now let’s look at the basic configuration file we can start the process of breaking down the included basic JSON configuration file. The Sumo Logic documentation has the full list of options you can set.
This is the _source directive and names the source
Tells the collector that it should try to do automatic date parsing. This works well for most normal items though the Fortigate systems log with a key/value layout that requires a little more work
Defaults to false and is very useful for Java/Ruby stack traces
If you need to force the timezone to match something that the collector is unable to decide itself
Set the timezone of the source
Specifically define how to parse the date – this example is for a Fortigate
How should the incoming data be interpreted
If you are using a port than which protocol would you like to use
Port number to listen on
Sets the _sourceCategory flag for searching
Type of item to inject – syslog (over a port) or localfile (a local file to read
One hint: values of true and false should not have double-quotes added but everything else requires double-quotes.
And if you did not click above to download the JSON file it is below to browse.