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 support for fields and protocol lookups in port_name. #8157

Merged
merged 6 commits into from Oct 19, 2020
Merged

Add support for fields and protocol lookups in port_name. #8157

merged 6 commits into from Oct 19, 2020

Conversation

a-bali
Copy link
Contributor

@a-bali a-bali commented Sep 20, 2020

Improve functionality of the port_name plugin by:

  • allowing source to be provided as a field (not only as a tag)
  • output will be provided as a field if input was a field as well
  • additional tag/field can be provided to specify the protocol (tcp/udp)

Documentation and tests are updated accordingly.

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

plugins/processors/port_name/port_name.go Outdated Show resolved Hide resolved
plugins/processors/port_name/port_name.go Show resolved Hide resolved
plugins/processors/port_name/port_name.go Outdated Show resolved Hide resolved
plugins/processors/port_name/port_name.go Outdated Show resolved Hide resolved
@ssoroka ssoroka requested a review from reimda September 21, 2020 15:19
@reimda
Copy link
Contributor

reimda commented Sep 21, 2020

Hi @a-bali, thanks for the PR.

I wrote port_name to fill a specific need of the sflow input plugin so I'm curious how you are reusing it. I'm not opposed to changing it but I want to have a better idea of the problem you're trying to solve. Could you describe how you use port_name? Where did your data with ports as fields come from?

Have you considered using the converter processor to change the field to tag or tag to field?

@a-bali
Copy link
Contributor Author

a-bali commented Sep 22, 2020

I wrote port_name to fill a specific need of the sflow input plugin so I'm curious how you are reusing it. I'm not opposed to changing it but I want to have a better idea of the problem you're trying to solve. Could you describe how you use port_name? Where did your data with ports as fields come from?

Thank you for writing this plugin. I'm processing firewall logs with the tail input plugin and a grok pattern that parses the various fields in the log. I am using the port_name plugin (and others) to enrich/transform this data for reporting and visualization.

Have you considered using the converter processor to change the field to tag or tag to field?

I guess that is an option, but it would require additional steps and I saw that other processor plugins (e.g. reverse_dns) also support using fields/tags in the input/output. Also the PR contains functionality to use a dedicated field to specify the protocol (tcp/udp) which I have in the firewall log.

@a-bali a-bali requested a review from ssoroka October 15, 2020 08:06
Copy link
Contributor

@ssoroka ssoroka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but there's a couple small changes, as well we should probably support uint64

plugins/processors/port_name/port_name.go Show resolved Hide resolved
plugins/processors/port_name/port_name.go Outdated Show resolved Hide resolved
plugins/processors/port_name/port_name.go Outdated Show resolved Hide resolved
plugins/processors/port_name/port_name.go Outdated Show resolved Hide resolved
@a-bali a-bali requested a review from ssoroka October 18, 2020 15:42
@ssoroka ssoroka merged commit 87fcea5 into influxdata:master Oct 19, 2020
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants