# FluentD: cannot send logs to UDP port of GrayLog (only TCP)

**URL:** https://community.graylog.org/t/fluentd-cannot-send-logs-to-udp-port-of-graylog-only-tcp/18150
**Category:** Graylog Central (peer support)
**Created:** [December 10, 2020, 5:25pm UTC](https://community.graylog.org/t/fluentd-cannot-send-logs-to-udp-port-of-graylog-only-tcp/18150 "2020-12-10T17:25:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![dimedrol](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/dimedrol/32/7584_2.png) [@dimedrol](https://community.graylog.org/u/dimedrol)
#### Post date: [December 10, 2020, 5:25pm UTC](https://community.graylog.org/t/fluentd-cannot-send-logs-to-udp-port-of-graylog-only-tcp/18150/1 "2020-12-10T17:25:36Z")

</div>

Sorry about possible offtopic (FluentD), but in case of anyone aware of…  
I’ve got GrayLog instance up and running.  
I can _forward_ my logs from FluentD remote host to GrayLog port.  
I see the logs, everything is fine.  
BUT!  
I only can send logs to **TCP port**!  
On FluentD side config is:

```auto
<match mytag>
  @type gelf
  host graylog.example.com
  port 12333
  #protocol udp
  <buffer>
    flush_interval 3s
  </buffer>
</match>

```

I trued with and without `protocol udp` setting. No luck.  
It always sends logs **to TCP port**.

I even tried to send some UDP data **from remote host** to my GrayLog instance:

```auto
echo "ssssssssssss" | netcat -u graylog.example.com 12333

```

It works!  
I see:

```auto
Throughput / Metrics
1 minute average rate: 0 msg/s
Network IO: 0B 0B (total: 16.0B 0B )

```

**16 bytes received!**  
So, port is open and GrayLog is receiving data.

But, what’s with FluentD?  
How to configure FluentD to use UDP port for log sending?

---

<div class="post-metadata">

### Author: ![dimedrol](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/dimedrol/32/7584_2.png) [@dimedrol](https://community.graylog.org/u/dimedrol)
#### Post date: [December 18, 2020, 10:08am UTC](https://community.graylog.org/t/fluentd-cannot-send-logs-to-udp-port-of-graylog-only-tcp/18150/2 "2020-12-18T10:08:59Z")

</div>

Solved!  
Just use “fluent-plugin- **gelf-hs** ” plugin for FluentD, instead of “fluent-plugin-_gelf_”  
Here’s my working Dockerfile for building GELF-UDP-enabled FluentD:

> **[divlv/fluentd](https://github.com/divlv/fluentd)**
>
> FluentD logs collector with extra plugins. Contribute to divlv/fluentd development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)
#### Post date: [January 1, 2021, 10:09am UTC](https://community.graylog.org/t/fluentd-cannot-send-logs-to-udp-port-of-graylog-only-tcp/18150/3 "2021-01-01T10:09:02Z")

</div>

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