Elasitcsearch is really a document database of sorts. Think of using it to store logs or messages.
InfluxDB is a time series database. Think of using it to store periodic measurement data (generally samples or point in time measurements).
For a complete solution you really need both of them.