# Write logs from wordpress in the elasticsearch

**URL:** <https://discuss.elastic.co/t/write-logs-from-wordpress-in-the-elasticsearch/307587>\
**Category:** Elasticsearch\
**Created:** [June 19, 2022, 2:30pm UTC](https://discuss.elastic.co/t/write-logs-from-wordpress-in-the-elasticsearch/307587 "2022-06-19T14:30:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frida](https://avatars.discourse-cdn.com/v4/letter/f/57b2e6/32.png) [@Frida](https://discuss.elastic.co/u/Frida)\
**Post date:** [June 19, 2022, 2:30pm UTC](https://discuss.elastic.co/t/write-logs-from-wordpress-in-the-elasticsearch/307587/1 "2022-06-19T14:30:33Z")

</div>

Hi,  
If possible- I ave a question:  
I have a elk cluster.  
this is my mysql deployment:

```auto
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql
  namespace: database 
  labels:
    app: mysql
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mysql
  template:
    metadata:
      labels:
        app: mysql
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: disktype
                operator: In
                values:
                - ssd
      containers:
        - image: mysql:5.6
          name: mysql
          env:
            - name: MYSQL_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mysql
                  key: password
          ports:
            - containerPort: 3306
              name: mysql
          volumeMounts:
            - name: mysql-persistent-storage
              mountPath: /var/lib/mysql
      volumes:
        - name: mysql-persistent-storage
          persistentVolumeClaim:
            claimName: mysql-pvc

```

and this is my wordpress deployment:

```auto
apiVersion: apps/v1
kind: Deployment
metadata:
  name: wordpress
  namespace: some
  labels:
    app: wordpress
spec:
  selector:
    matchLabels:
      app: wordpress
  template:
    metadata:
      labels:
        app: wordpress
    spec:
      containers:
      - image: wordpress:5.9.3
        name: wordpress
        env:
        - name: WORDPRESS_DB_HOST
          value: mysql-service
        - name: WORDPRESS_DB_PASSWORD
          valueFrom:
            secretKeyRef:
              name: source-mysql
              key: password
        ports:
        - containerPort: 80
          name: wordpress
        volumeMounts:
        - name: wordpress-persistent-storage
          mountPath: /var/www/html
      volumes:
      - name: wordpress-persistent-storage
        persistentVolumeClaim:
          claimName: wordpress-pvc

```

and I have Elasticsearch end kibana:

```auto
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: bcdelasticsearchcd
spec:
  version: 7.6.2
  nodeSets:
  - name: default
    count: 1
    config:
      node.master: true
      node.data: true
      node.ingest: true
      node.store.allow_mmap: false
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
  name: quickstart
spec:
  version: 7.6.2
  count: 1
  elasticsearchRef:
    name: bcdsticsearch
  http:
    service:
        spec:
            type: LoadBalancer

```

I need all the logs of the wordprees to be written in the Elasticsearch,  
how can I do that?  
thanks!  
Frida

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 20, 2022, 12:59am UTC](https://discuss.elastic.co/t/write-logs-from-wordpress-in-the-elasticsearch/307587/2 "2022-06-20T00:59:35Z")

</div>

Filebeat would be your best option for this. Look at using the docker integration.

---

<div class="post-metadata">

**Author:** ![Frida](https://avatars.discourse-cdn.com/v4/letter/f/57b2e6/32.png) [@Frida](https://discuss.elastic.co/u/Frida)\
**Post date:** [June 20, 2022, 9:22am UTC](https://discuss.elastic.co/t/write-logs-from-wordpress-in-the-elasticsearch/307587/3 "2022-06-20T09:22:37Z")

</div>

Thanks,  
now I need for that the url of the kibana and the url of the Elasticsearch,

```auto
output.elasticsearch:
  hosts: ["<es_url>"]
  username: "elastic"
  password: "<password>"
setup.kibana:
  host: "<kibana_url>"

```

how can I get these?  
thanks

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 18, 2022, 9:22am UTC](https://discuss.elastic.co/t/write-logs-from-wordpress-in-the-elasticsearch/307587/4 "2022-07-18T09:22:59Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
