Setting Elasticsearch environment Variables

Quick Q.

How do i parse elasticsearch variables into the YML?

I need to put the IP for dynamically for spawned slaves and ive set an environment variable like:

ip="$(ifconfig | grep -A 1 'eth0' | tail -1 | cut -d ':' -f 2 | cut -d ' ' -f 1)"

Which returns just the IP address of Eth0 from my VM

And in the .yml File i've tried to allocate it to ${ip}

Yet this is not working. However, in $(HOSTNAME} variable works?

I also need to set it for the cluster_name also so any insight will really help.

Why not just use _eth0_, as per

Thanks man! That works :slight_smile:

One more thing, when naming the index's we want to use "elasticsearch_$date"

Where $date is the timestamp of the days date the index was created. Is there any way of parsing that to ES have the index prefix with "elasticsearch_$date$"?


You need to pass that into ES when you create the index, ES doesn't automatically convert that.