Skip to content

Commit

Permalink
mod,x-pack/filebeat/input/cel: update mito dependency (#33974)
Browse files Browse the repository at this point in the history
This brings in improvements in the collection extension behaviour and
support for context.Context in the HTTP extension.

2f0f2875 lib: add HTTPWithContext cel.EnvOption
fa5b7a0f lib: allow specification of dotted path elements in collate and drop
  • Loading branch information
efd6 authored and chrisberkhout committed Jun 1, 2023
1 parent f5c8632 commit 74e726a
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 75 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ https://github.com/elastic/beats/compare/v8.2.0\...main[Check the HEAD diff]
- Fix PANW handling of messages with event.original already set. {issue}33829[33829] {pull}33830[33830]
- Rename identity as identity_name when the value is a string in Azure Platform Logs. {pull}33654[33654]
- Fix input cancellation handling when HTTP client does not support contexts. {issue}33962[33962] {pull}33968[33968]
- Update mito CEL extension library to v0.0.0-20221207004749-2f0f2875e464 {pull}33974[33974]

*Heartbeat*
- Fix broken zip URL monitors. NOTE: Zip URL Monitors will be removed in version 8.7 and replaced with project monitors. {pull}33723[33723]
Expand Down
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12988,11 +12988,11 @@ limitations under the License.

--------------------------------------------------------------------------------
Dependency : github.com/elastic/mito
Version: v0.0.0-20221025013803-2ab0322317ce
Version: v0.0.0-20221207004749-2f0f2875e464
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]20221025013803-2ab0322317ce/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/elastic/[email protected]20221207004749-2f0f2875e464/LICENSE:


Apache License
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ require (
github.com/elastic/elastic-agent-shipper-client v0.4.0
github.com/elastic/elastic-agent-system-metrics v0.4.5-0.20220927192933-25a985b07d51
github.com/elastic/go-elasticsearch/v8 v8.2.0
github.com/elastic/mito v0.0.0-20221025013803-2ab0322317ce
github.com/elastic/mito v0.0.0-20221207004749-2f0f2875e464
github.com/elastic/toutoumomoma v0.0.0-20221026030040-594ef30cb640
github.com/google/cel-go v0.12.5
github.com/googleapis/gax-go/v2 v2.5.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,8 @@ github.com/elastic/gopacket v1.1.20-0.20211202005954-d412fca7f83a h1:8WfL/X6fK11
github.com/elastic/gopacket v1.1.20-0.20211202005954-d412fca7f83a/go.mod h1:riddUzxTSBpJXk3qBHtYr4qOhFhT6k/1c0E3qkQjQpA=
github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4=
github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
github.com/elastic/mito v0.0.0-20221025013803-2ab0322317ce h1:SoiSsz4ZB6WshNBGr8LrjZWsOjWsV8yJ4/ebcBx9ckk=
github.com/elastic/mito v0.0.0-20221025013803-2ab0322317ce/go.mod h1:wT2Gr9P4Ascfb7D+Pomb9TPfN++QrU8AIYFQDgCJi+I=
github.com/elastic/mito v0.0.0-20221207004749-2f0f2875e464 h1:16SML3MWc23Q5nXlVwVBCtZYHO4Hhgy6KKLkQ9dMozc=
github.com/elastic/mito v0.0.0-20221207004749-2f0f2875e464/go.mod h1:wT2Gr9P4Ascfb7D+Pomb9TPfN++QrU8AIYFQDgCJi+I=
github.com/elastic/ristretto v0.1.1-0.20220602190459-83b0895ca5b3 h1:ChPwRVv1RR4a0cxoGjKcyWjTEpxYfm5gydMIzo32cAw=
github.com/elastic/ristretto v0.1.1-0.20220602190459-83b0895ca5b3/go.mod h1:RAy2GVV4sTWVlNMavv3xhLsk18rxhfhDnombTe6EF5c=
github.com/elastic/sarama v1.19.1-0.20220310193331-ebc2b0d8eef3 h1:FzA0/n4iMt8ojGDGRoiFPSHFvvdVIvxOxyLtiFnrLBM=
Expand Down
132 changes: 66 additions & 66 deletions x-pack/filebeat/docs/inputs/input-cel.asciidoc

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion x-pack/filebeat/input/cel/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package cel

import (
"context"
"errors"
"fmt"
"net/http"
Expand Down Expand Up @@ -59,7 +60,7 @@ func (c config) Validate() error {
if len(c.Regexps) != 0 {
patterns = map[string]*regexp.Regexp{".": nil}
}
_, err = newProgram(c.Program, root, client, nil, patterns)
_, err = newProgram(context.Background(), c.Program, root, client, nil, patterns)
if err != nil {
return fmt.Errorf("failed to check program: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions x-pack/filebeat/input/cel/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (input) run(env v2.Context, src *source, cursor map[string]interface{}, pub
return err
}

prg, err := newProgram(cfg.Program, root, client, limiter, patterns)
prg, err := newProgram(ctx, cfg.Program, root, client, limiter, patterns)
if err != nil {
return err
}
Expand Down Expand Up @@ -808,7 +808,7 @@ var (
}
)

func newProgram(src, root string, client *http.Client, limiter *rate.Limiter, patterns map[string]*regexp.Regexp) (cel.Program, error) {
func newProgram(ctx context.Context, src, root string, client *http.Client, limiter *rate.Limiter, patterns map[string]*regexp.Regexp) (cel.Program, error) {
opts := []cel.EnvOption{
cel.Declarations(decls.NewVar(root, decls.Dyn)),
lib.Collections(),
Expand All @@ -825,7 +825,7 @@ func newProgram(src, root string, client *http.Client, limiter *rate.Limiter, pa
}),
}
if client != nil {
opts = append(opts, lib.HTTP(client, limiter))
opts = append(opts, lib.HTTPWithContext(ctx, client, limiter))
}
if len(patterns) != 0 {
opts = append(opts, lib.Regexp(patterns))
Expand Down

0 comments on commit 74e726a

Please sign in to comment.