Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add source_address and source_host for syslog/udp input #2419

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

carrotop
Copy link

@carrotop carrotop commented Aug 4, 2020

This provides the feature of adding the src host and src address when using the syslog input source. It behaves similarly to fluentd proper, and uses the same keys in its configuration. E.g. Source_Hostname_Key and Source_Address_Key. Essentially, when these configurations are specified in the configuration, when a UDP connection is established it adds these attributes to the resulting log data.

As I'm not that familiar with msgpack, I'm sure there is a more efficient way to accomplish what I did here. I imagine that there will have to be a few revisions, which is why I'm not going to fill out the entirel pull request form, as I imagine this info may change as time goes on.

N/A

Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
[INPUT]
    Name syslog
    Tag cool
    Parser generic
    Port 514
    Mode udp
    Source_Hostname_Key src_host
    Source_Address_Key src_addr

[OUTPUT]
    Name stdout
    Match *
  • Debug log output from testing the change
[root@2187e7fc5060 bin]# echo 'This is kind of crazy' | ncat -u 127.0.0.1 514
[root@2187e7fc5060 bin]# [0] cool: [1596554014.039203200, {"text"=>"This is kind of crazy", "src_addr"=>"127.0.0.1", "src_host"=>"anantes-650-1-50-46.w2-0.abo.wanadoo.fr"}]
[2020/08/04 15:13:34] [debug] [task] created task=0x15ff340 id=0 OK
[0] cool: [1596554014.039203200, {"text"=>"This is kind of crazy", "src_addr"=>"127.0.0.1", "src_host"=>"anantes-650-1-50-46.w2-0.abo.wanadoo.fr"}]
[2020/08/04 15:13:34] [debug] [task] destroy task=0x15ff340 (task_id=0)

I am on a private network (and using loopback) so the hostname resolution is weird, but normally it would resolve to the address of the source.

  • Attached Valgrind output that shows no leaks or memory corruption was found
    Will perform this if this is a change you are interested in.

Documentation

  • Documentation required for this feature
    The docs will need to be updated and I'm willing to do that if you think this is change you want to include in the main baseline.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

@github-actions
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Apr 28, 2021
@ryn9
Copy link

ryn9 commented Jan 18, 2024

while source_hostname_key was not implemented, source_address_key via another PR.
Reference: #7651

Maybe this should get closed out?

@github-actions github-actions bot removed the Stale label Jan 19, 2024
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants