Skip to content

Commit

Permalink
fix linter, logs, changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
fearful-symmetry committed Dec 5, 2024
1 parent 7b37895 commit bb65116
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Remove unnecessary debug logs during idle connection teardown {issue}40824[40824]
- Fix incorrect cloud provider identification in add_cloud_metadata processor using provider priority mechanism {pull}41636[41636]
- Prevent panic if libbeat processors are loaded more than once. {issue}41475[41475] {pull}41857[51857]
- Allow network processor to handle multiple IPs {pull}41918[41918]
- Allow network condition to handle multiple IPs {pull}41918[41918]

*Auditbeat*

Expand Down
7 changes: 2 additions & 5 deletions libbeat/conditions/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ func NewNetworkCondition(fields map[string]interface{}) (*Network, error) {
log: logp.NewLogger(logName),
}

//nolint: typecheck // linter is confused
makeMatcher := func(network string) (networkMatcher, error) {
makeMatcher := func(network string) (networkMatcher, error) { //nolint: typecheck // linter is confused

Check failure on line 104 in libbeat/conditions/network.go

View workflow job for this annotation

GitHub Actions / lint (windows)

directive `//nolint: typecheck // linter is confused` is unused for linter "typecheck" (nolintlint)

Check failure on line 104 in libbeat/conditions/network.go

View workflow job for this annotation

GitHub Actions / lint (linux)

directive `//nolint: typecheck // linter is confused` is unused for linter "typecheck" (nolintlint)
m := singleNetworkMatcher{name: network, netContainsFunc: namedNetworks[network]}
if m.netContainsFunc == nil {
subnet, err := parseCIDR(network)
Expand All @@ -114,8 +113,7 @@ func NewNetworkCondition(fields map[string]interface{}) (*Network, error) {
return m, nil
}

//nolint: typecheck // linter is confused
invalidTypeError := func(field string, value interface{}) error {
invalidTypeError := func(field string, value interface{}) error { //nolint: typecheck // linter is confused

Check failure on line 116 in libbeat/conditions/network.go

View workflow job for this annotation

GitHub Actions / lint (windows)

directive `//nolint: typecheck // linter is confused` is unused for linter "typecheck" (nolintlint)

Check failure on line 116 in libbeat/conditions/network.go

View workflow job for this annotation

GitHub Actions / lint (linux)

directive `//nolint: typecheck // linter is confused` is unused for linter "typecheck" (nolintlint)
return fmt.Errorf("network condition attempted to set "+
"'%v' -> '%v' and encountered unexpected type '%T', only "+
"strings or []strings are allowed", field, value, value)
Expand Down Expand Up @@ -166,7 +164,6 @@ func (c *Network) Check(event ValuesMap) bool {
}
// match on an "any" basis when we find multiple IPs in the event;
// if the network matcher returns true for any seen IP, consider it a match
fmt.Printf("matching: %v\n", ipList)
matches := 0
for _, ip := range ipList {
if network.Contains(ip) {
Expand Down

0 comments on commit bb65116

Please sign in to comment.