Skip to content

Commit

Permalink
packetbeat/procs: don't log at ERROR for file not found (#33854)
Browse files Browse the repository at this point in the history
When processes are short lived this spams the logs with unhelpful log
lines.
  • Loading branch information
efd6 authored and chrisberkhout committed Jun 1, 2023
1 parent 64e5cd5 commit ee3c4e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]
- Add option to allow sniffing multiple interface devices. {issue}31905[31905] {pull}32933[32933]
- Bump Windows Npcap version to v1.71. {issue}33164[33164] {pull}33172[33172]
- Add fragmented IPv4 packet reassembly. {issue}33012[33012] {pull}33296[33296]
- Reduce logging level for ENOENT to WARN when mapping sockets to processes. {issue}33793[33793] {pull}[]

*Functionbeat*

Expand Down
6 changes: 5 additions & 1 deletion packetbeat/procs/procs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ func (proc *ProcessesWatcher) GetLocalPortToPIDMapping(transport applayer.Transp
for _, pid := range pids.List {
inodes, err := findSocketsOfPid("", pid)
if err != nil {
logp.Err("FindSocketsOfPid: %s", err)
if os.IsNotExist(err) {
logp.Info("FindSocketsOfPid: %s", err)
} else {
logp.Err("FindSocketsOfPid: %s", err)
}
continue
}

Expand Down

0 comments on commit ee3c4e8

Please sign in to comment.