special0ne
special0ne

Reputation: 6263

How to start Splunk Forwarder within a script

I would like to start to monitor our dockers with Splunk. To do it I want to add it to the docker buildfile.

The issue is that if its the first time you start the forwarder, it prompts you to agree for the license agreement, which breaks the script.

Is there a way to start the Splunk forwarder without being prompted?

Upvotes: 1

Views: 933

Answers (1)

Matt
Matt

Reputation: 74720

The arguments you are looking for are --accept-license --answer-yes --no-prompt.

A Splunk employee publishes some Docker images on his own time that can cater for this already. Have a look at SPLUNK_START_ARGS in the forwarders entrypoint.sh.

Also, Docker natively supports sending its own logs to Splunk. This includes the stdout and stderr of all containers so you may not need your own forwarder.

Upvotes: 2

Related Questions