SumoLogic / sumologic-collector-docker

A Sumo Logic collector for Docker.
Apache License 2.0
69 stars 55 forks source link

Is there a way to overwrite collector.properties file? #74

Closed mhobotpplnet closed 5 years ago

mhobotpplnet commented 5 years ago

I understand that there is a manual way to manipulate the collector.properties file with instructions on README.md however that is not really optimal when you try automate the docker container for sumologic.

How does it get written overall? I could not find anywhere anything regards to it.

Here is the file contents..

receiver.url = https://endpoint1.collection.us2.sumologic.com
windows.remote.jni = true
cpuTarget = -1
json.sync.mode = Json
logIngestStatus = Normal
collector.debug.forceRestart = -1
bin3377 commented 5 years ago

You can probably using a customized docker image to modify the collector.properties if you want. Here is a sample (from root of repo):

$ cat ./my-Dockerfile
FROM sumologic/collector:latest-no-source
COPY sumo-sources.json /etc/sumo-sources.json
RUN echo docker.maxPerContainerConnections = 100 >> /opt/SumoCollector/config/collector.properties && \
    echo docker.apiVersion = 1.24 >> /opt/SumoCollector/config/collector.properties

$ docker build . -f ./my-Dockerfile -t me/sumo-docker

Sending build context to Docker daemon   68.1kB
Step 1/3 : FROM sumologic/collector:latest-no-source

...

Successfully built a9d5e0f0153b
Successfully tagged me/sumo-docker:latest

$ docker run -d -v /var/run/docker.sock:/var/run/docker.sock --name="my-collector" me/sumo-docker <accID> <accKey>
mhobotpplnet commented 5 years ago

I just ended up creating my own ..

FROM sumologic/collector:latest
MAINTAINER Sumo Logic <docker@sumologic.com>

COPY /conf/collector.properties /opt/SumoCollector/config/

Worked.