[Splunk - ECS ] Container Instance missing an attribute required by your task


(Mike) #1

I am trying to configure Splunk logging for docker containers in AWS ECS cluster using the following configuration in my task definition.

"logConfiguration": {
                "logDriver": "splunk",
                "options": {
                    "splunk-token": <my splunk token>,
                    "splunk-url": <my splunk url >,
                    "splunk-index": <my index>
                }
            }

While launching the tasks, I am getting the following error.

unable to place a task because no container instance met all of its requirements. The closest matching container-instance 4792b206-19a3-47e6-822b-70ef075cf3d2 is missing an attribute required by your task.

How to solve this issue?


(Bibin Wilson) #2

You should add splunk logging driver to you ECS agent instance.

First thing you need to do is set ECS_AVAILABLE_LOGGING_DRIVERS variable for splunk in /etc/ecs/ecs.config file.

In you ECS agent instance user data, you should add the following.

#!/bin/bash
echo ECS_AVAILABLE_LOGGING_DRIVERS='["splunk","awslogs"]' >> /etc/ecs/ecs.config

In you want to make these changes in a running instance, just execute the above command and then stop and start the ECS agent.

sudo stop ecs
sudo start ecs

Hope this will solve your issue!


(smaran) #3

Hi I tried doing so, this didn’t help me.

I have updated, my ecs. config file in /etc/ecs/ecs.config

ECS_CLUSTER=ecs
ECS_BACKEND_HOST=
ECS_AVAILABLE_LOGGING_DRIVERS=’[“splunk”,“awslogs”]’
sudo stop ecs
sudo start ecs
I am getting error message as below.

service ******* was unable to place a task because no container instance met all of its requirements. The closest matching container-instance******* is missing an attribute required by your task. For more information, see the Troubleshooting section.

Please let me know, what else we need to do to resolve this issue