The logstash plugin can forward logs to for both pipeline and
freestyle to elastic search and others.
But it doesn't support to read the logs from there to display in
Jenkins, what it forwards is rather heavy weight and for pipeline
jobs not the complete output is transferred (all the output from the
pipeline core not coming from a step itself is missing, like the
first lines with what caused the build and the final line with the
result)
There is an implementation for what you want to do at
https://github.com/SAP/elasticsearch-logs-plugin (inspired by the
cloudwatch logs plugin)
This plugin was mainly implemented to forward the logs of a
JenkinsFileRunner from inside a short living Kubernetes pod so it is
available outside. It is partially generic as it has an extension
point (similar to logstash plugin) and we implemented also
forwarding to fluentd (that will then forward to Elastic Search,
this has proven to be more robust in our scenario).
It can also read from ES, but performance is rather bad here. Also
some plugins still rely on the log being available in the file
system, so we decided to have both though this meant to copy code
from the pipeline plugins.
It can also forward logs of Freestyle jobs.
The plugin also provides eventing for pipeline steps and transfers
much less data than the logstash plugin.