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

Update netstat_filter.go #569

Merged
merged 1 commit into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions inputs/netstat_filter/netstat_filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

const inputName = "netstat_filter"

var executed = false
type NetStatFilter struct {
config.PluginConfig
Instances []*Instance `toml:"instances"`
Expand Down Expand Up @@ -115,7 +115,11 @@ func (ins *Instance) Gather(slist *types.SampleList) {
send = value.Txq
recv = value.Rxq
} else {
log.Println("E! Key not matched, TCP_ Send_ Queue, TCP_ Recv_Queue, The queue value is 0")
if !executed {
// 执行只需要在启动后执行一次的代码
log.Println("E! init Key not matched, TCP_ Send_ Queue, TCP_ Recv_Queue, The queue value is 0,key:", key)
executed = true
}
}

fields := map[string]interface{}{
Expand Down