Setting Elasticsearch environment Variables

Hi,
Quick Q.

How do i parse elasticsearch variables into the YML?

I need to put the IP for network.host 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

network.host ${ip}

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

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

Why not just use network.host: _eth0_, as per https://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-network.html#network-interface-values

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$"?

Thanks

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