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 processor to look up service name by port #7540

Merged
merged 4 commits into from
May 27, 2020
Merged

Conversation

reimda
Copy link
Contributor

@reimda reimda commented May 18, 2020

closes #7244

@reimda reimda requested a review from danielnelson May 18, 2020 21:48
Copy link
Contributor

@danielnelson danielnelson left a comment

Choose a reason for hiding this comment

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

Looks great

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 Show resolved Hide resolved
var err error
port, err = strconv.Atoi(portProtoSlice[0])
if err != nil {
// Can't convert port to string
Copy link
Contributor

Choose a reason for hiding this comment

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

Log this as an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added logging here and in most other cases in Apply. It now logs an error if they provide the port tag but it's empty, or if it's not empty but won't parse as an int, or if they supply a protocol that isn't in the services file (meaning not tcp or udp). It logs a debug message if the port/protocol isn't in the services file.

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/services_path_notwin.go Outdated Show resolved Hide resolved
plugins/processors/port_name/services_path.go Outdated Show resolved Hide resolved
plugins/processors/port_name/README.md Show resolved Hide resolved
@danielnelson danielnelson added this to the 1.15.0 milestone May 19, 2020
@reimda reimda requested a review from danielnelson May 20, 2020 21:30
@reimda reimda merged commit 71b0b96 into master May 27, 2020
jaecktec pushed a commit to jaecktec/telegraf that referenced this pull request Jun 8, 2020
rhajek pushed a commit to bonitoo-io/telegraf that referenced this pull request Jul 13, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
@sspaink sspaink deleted the port_name-processor branch October 19, 2021 20:49
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add processor that does service port to name translation
2 participants