How can I write the logs from the wordpress deployment to elastic?

If possible I have a question:
I have a wordpress deployment (with load balancer),
and I have kibana (with load balancer),
Now I want the logs from wordpress to be written in elasticsearch.
How am I supposed to do that?
Thank you

There are a number of different ways to do it using a variety of different tools. Elasticsearch has their own log agent that you can run. There are othere more generic ones like fluentd, take a look at some of the tools here and go with the one that best suits your needs: