diff --git a/contrib/logging/fluentd-es-image/run.sh b/contrib/logging/fluentd-es-image/run.sh index 4b8e4e8f5e8..17e680afa41 100755 --- a/contrib/logging/fluentd-es-image/run.sh +++ b/contrib/logging/fluentd-es-image/run.sh @@ -14,7 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +# WARNING! HORRIBLE HACK! We expect /outerhost to be mapped to +# the enclosing /etc/host file so we can determine the name of +# the host machine (super fragile). This is a temporary hack until +# service IPs are done. OUTER_HOST=`tail -n 1 /outerhost | awk '{print $3}'` + +# Copy the Fluentd config file and patch it to refer to the +# name of the host machine for ES_HOST. HACK! cp td-agent.conf /etc/td-agent sed -i -e "s/ES_HOST/${OUTER_HOST}/" /etc/td-agent/td-agent.conf /usr/sbin/td-agent