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

mod,x-pack/filebeat/input/cel: update mito dependency #33974

Merged
merged 2 commits into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
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
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