# How to send logs to logstash outside the kubernetes cluster

**URL:** <https://discuss.elastic.co/t/how-to-send-logs-to-logstash-outside-the-kubernetes-cluster/323322>\
**Category:** Logstash\
**Created:** [January 17, 2023, 12:38pm UTC](https://discuss.elastic.co/t/how-to-send-logs-to-logstash-outside-the-kubernetes-cluster/323322 "2023-01-17T12:38:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sulfred](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sulfred/32/101276_2.png) [@sulfred](https://discuss.elastic.co/u/sulfred)\
**Post date:** [January 17, 2023, 12:38pm UTC](https://discuss.elastic.co/t/how-to-send-logs-to-logstash-outside-the-kubernetes-cluster/323322/1 "2023-01-17T12:38:50Z")

</div>

Hi all,

I followed [this page](https://artifacthub.io/packages/helm/elastic/logstash) to set up a logstash with k8s.

I can send logs to this logstash within the k8s cluster from other pods.  
But, I cannot send logs to the logstash outside the cluster.

Here is my settings:

- minikube: v1.28.0
- kubectl: client - 1.26.0, server - 1.25.3
- helm: v3.10.3
- ubuntu: 20.04

Here is my additional yaml configs:

```auto
ingress:
  enabled: true
  hosts:
    - host: logstash-gelf.testing.com
      paths:
        - path: /
          servicePort: 5959
    - host: logstash-tcp.testing.com
      paths:
        - path: /
          servicePort: 5960

service:
  # annotations: {}
  type: ClusterIP
  # loadBalancerIP: ""
  ports:
    - name: gelf-port
      port: 5959
      protocol: UDP
      targetPort: 5959
    - name: tcp-port
      port: 5960
      protocol: TCP
      targetPort: 5960

extraPorts:
  - name: gelf-port
    containerPort: 5959
  - name: tcp-port
    containerPort: 5960

```

ingress describe

```auto
$ kubectl describe ingress logstash-elastic-logstash
Name: logstash-elastic-logstash
Labels: app=logstash-elastic-logstash
                  app.kubernetes.io/managed-by=Helm
                  chart=logstash
                  heritage=Helm
                  release=logstash-elastic
Namespace: default
Address:          
Ingress Class: nginx
Default backend: <default>
Rules:
  Host Path Backends
  ---- ---- --------
  logstash-gelf.testing.com  
                            / logstash-elastic-logstash:5959 (172.17.0.3:5959)
  logstash-tcp.testing.com   
                            / logstash-elastic-logstash:5960 (172.17.0.3:5960)
Annotations: meta.helm.sh/release-name: logstash-elastic
                            meta.helm.sh/release-namespace: default
Events: <none>

```

The command I tried to use for sending logs:

```auto
# from host --- failed
$ echo "Test message" | nc -q0 logstash-tcp.testing.com 80

```

```auto
# from other pod within the cluster --- success
$ echo "Test message" | nc -q0 logstash-elastic-logstash 5960

```

Anyone has related experience on this?

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:** [February 14, 2023, 12:39pm UTC](https://discuss.elastic.co/t/how-to-send-logs-to-logstash-outside-the-kubernetes-cluster/323322/2 "2023-02-14T12:39:23Z")

</div>

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