fluent-bit icon indicating copy to clipboard operation
fluent-bit copied to clipboard

udp json input support

Open nvx opened this issue 5 years ago • 20 comments

Is your feature request related to a problem? Please describe. There is currently a json tcp input, but no corresponding option for udp

Describe the solution you'd like Having the ability to consume json events sent over udp would be beneficial

nvx avatar Apr 03 '19 06:04 nvx

would you please elaborate your use case ?

edsiper avatar Apr 03 '19 22:04 edsiper

Reliably transporting logs sent from applications via UDP.

In some instances it is desirable for the application to emit logs via UDP rather than handle reconnection/buffering/blocking/etc in the application where dropping logs in the event of logging infrastructure failures are acceptable. The main problem with this approach is that sending UDP over the network offers very little guarantees.

A pattern I have used is ingesting UDP logs over localhost to a local agent, which in turn then takes care of buffering and reliably sending over the network. This pattern can be achieved today with the in_udp fluentd input, Logstash, or nxlog. The downside is the former two agents are quite heavyweight, while nxlog meets the lightweight requirement it's capabilities are rather limited compared to eg fluent-bit.

The use-case is similar to syslog ingestion over tcp vs udp which I note fluent-bit supports both today.

nvx avatar Apr 04 '19 02:04 nvx

I got pretty much the same case that @nvx, so i'd like to vote up for this feature.

newrushbolt avatar Apr 28 '19 08:04 newrushbolt

Same scenario here - are there any plans to make that happen?

proligde avatar Sep 13 '19 13:09 proligde

Likewise, would be nice to have UDP input

dontspamterry avatar Oct 24 '19 23:10 dontspamterry

+1 for UDP input, we would like to replace rsyslog forwarder with fluent-bit

p53 avatar Nov 18 '19 13:11 p53

Is there still any information needed? I notice the awaiting for user label is still on this @edsiper

nvx avatar Mar 24 '20 05:03 nvx

Is there any timeline/update for this? UDP input would be a HUGE win for streaming logs with fluent bit.

jwitrick avatar Jun 10 '20 18:06 jwitrick

Actually in_syslog could be used as generic UDP input.. .just by giving suitable parser. I thought that if we just take in_syslog and copy it to as in_udp (some search/replace). Then add right method to parse tag name from message... and we have generic UDP input.

Also this could be used for something like in_influxdb for influxdb line protocol with UDP. In that case it would better to InfluxDB line protocol parser (regex is not really enough for that).

bluebike avatar Jun 26 '20 12:06 bluebike

We have this use case. I'm an engineer at New Relic and we would like to be able to offer this option to our users who use fluentbit as a forwarder.

JimHagan avatar Jul 31 '20 20:07 JimHagan

@JimHagan Few weeks ago I copied in_syslog to in_udp ... replaces syslog to udp... and did some testing (didn't have to time do more...) I could try to make PR in few days..

bluebike avatar Aug 02 '20 21:08 bluebike

I made PR #2414 in_udp module... @nvx @JimHagan You could have test... or give comments if module would cover your needs.

I have tested it only in my macOS (10.13) so far.

bluebike avatar Aug 04 '20 09:08 bluebike

One further use case:

Sending kernel and early user space (initramfs) logs via the netconsole kernel module over UDP before any other logging daemon is running during system boot.

I use that with Coinboot for a huge number of diskless nodes without any KVM over IP capabilities for debugging early boot stages. These kernel message don't align with RFC 3164 or RFC 5424 and so fail to be ingested by the in_syslog module.

frzb avatar Nov 15 '20 07:11 frzb

@bluebike What's about your PR? Is it staled? I would appreciate to have this feature on fluent-bit.

parera10 avatar Nov 08 '21 23:11 parera10

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

github-actions[bot] avatar Feb 07 '22 01:02 github-actions[bot]

ping

nvx avatar Feb 07 '22 10:02 nvx

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

github-actions[bot] avatar May 09 '22 02:05 github-actions[bot]

ping

nvx avatar May 09 '22 12:05 nvx

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

github-actions[bot] avatar Aug 08 '22 02:08 github-actions[bot]

still relevant

nvx avatar Aug 08 '22 03:08 nvx

ping

mokaton avatar Oct 14 '22 23:10 mokaton

Hello mates, another usecase here is to replace logstash when it is configured with the udp input. Is the PR ready to merge?

achetronic avatar Nov 19 '22 00:11 achetronic

I don't know about the PR but a while ago while working in the downstream provider I created both a UDS and UDP input plugins.

These were created for testing and are basically fleshed out copies of the TCP input plugin so they could need a bit of tuning but don't hesitate to ping me so I can fix any issues that arise.

Note : There is no official documentation for in_udp and in_unix_socket because as I said those were created by me for testing purposes mostly but I'm sure they will get properly documented in due time if they prove to be useful.

leonardo-albertovich avatar Nov 19 '22 10:11 leonardo-albertovich

@leonardo-albertovich Hello! :) thank you for the response. I saw this src after you told me it exists but I would appreciate if you could help with the documentation about how to configure the input, etc, to test it myself :)

achetronic avatar Nov 19 '22 13:11 achetronic

This should get you going :

[INPUT]
    name udp
    listen 127.0.0.1
    port 9990

[INPUT]
    name udp
    listen 127.0.0.1
    port 9991
    format none

[INPUT]
    name udp
    listen 127.0.0.1
    port 9992
    format none
    separator |

With this config fluent-bit will be waiting for :

  1. json formatted data on port 9990
  2. raw data separated by new lines on port 9991
  3. raw data separated by pipes on port 9992

Just keep in mind that if you send multiple entries in a single packet you need to send one separator per entry (ie. if you send 1|2 to port 9992 fluent-bit will only ingest 1 but if you send 1|2| it will ingest both entries as individual records which I'm not really sure is the intended operation mode but if it's not then we should check in_tcp to determine if it behaves in the same way and then report the issue (that way I'll have to fix in_tcp and will fix both in_udp and in_unix_socket as a side effect).

Hope it helps!

leonardo-albertovich avatar Nov 19 '22 14:11 leonardo-albertovich

@leonardo-albertovich good I can remove my staled PR #2414

bluebike avatar Nov 19 '22 15:11 bluebike

This should get you going :

[INPUT]
    name udp
    listen 127.0.0.1
    port 9990

[INPUT]
    name udp
    listen 127.0.0.1
    port 9991
    format none

[INPUT]
    name udp
    listen 127.0.0.1
    port 9992
    format none
    separator |

With this config fluent-bit will be waiting for :

1. `json` formatted data on port 9990

2. raw data separated by new lines on port 9991

3. raw data separated by pipes on port 9992

Just keep in mind that if you send multiple entries in a single packet you need to send one separator per entry (ie. if you send 1|2 to port 9992 fluent-bit will only ingest 1 but if you send 1|2| it will ingest both entries as individual records which I'm not really sure is the intended operation mode but if it's not then we should check in_tcp to determine if it behaves in the same way and then report the issue (that way I'll have to fix in_tcp and will fix both in_udp and in_unix_socket as a side effect).

Hope it helps!

Oh, thank you! I will test it and give some feedback. If everything is ok, I can collaborate in the documentation if needed

achetronic avatar Nov 21 '22 08:11 achetronic

I'm sure it would be highly appreciated.

leonardo-albertovich avatar Nov 21 '22 10:11 leonardo-albertovich

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the exempt-stale label.

github-actions[bot] avatar Feb 20 '23 02:02 github-actions[bot]

It sounds like this can be closed other than perhaps some docs describing how to use it?

nvx avatar Feb 20 '23 02:02 nvx