Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -476,6 +476,7 @@ otherwise no tag is added. {issue}42208[42208] {pull}42403[42403]
- Update CEL mito extensions to v1.21.0. {issue}40762[40762] {pull}45107[45107]
- Add Fleet health status reporting to the entity analytics input. {issue}44269[44269] {pull}45152[45152]
- Add Fleet status updating to o356audit input. {issue}44651[44651] {pull}44957[44957]
- Update CEL mito extensions to v1.22.0. {pull}45245[45245]

*Auditbeat*

Expand Down
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15556,11 +15556,11 @@ limitations under the License.

--------------------------------------------------------------------------------
Dependency : github.com/elastic/mito
Version: v1.21.0
Version: v1.22.0
Licence type (autodetected): Apache-2.0
--------------------------------------------------------------------------------

Contents of probable licence file $GOMODCACHE/github.com/elastic/mito@v1.21.0/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/elastic/mito@v1.22.0/LICENSE:


Apache License
Expand Down
158 changes: 79 additions & 79 deletions docs/reference/filebeat/filebeat-input-cel.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ require (
github.com/elastic/go-freelru v0.16.0
github.com/elastic/go-quark v0.3.0
github.com/elastic/go-sfdc v0.0.0-20241010131323-8e176480d727
github.com/elastic/mito v1.21.0
github.com/elastic/mito v1.22.0
github.com/elastic/mock-es v0.0.0-20240712014503-e5b47ece0015
github.com/elastic/sarama v1.19.1-0.20250603175145-7672917f26b6
github.com/elastic/tk-btf v0.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ github.com/elastic/gopacket v1.1.20-0.20241002174017-e8c5fda595e6 h1:VgOx6omXIMK
github.com/elastic/gopacket v1.1.20-0.20241002174017-e8c5fda595e6/go.mod h1:riddUzxTSBpJXk3qBHtYr4qOhFhT6k/1c0E3qkQjQpA=
github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo=
github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
github.com/elastic/mito v1.21.0 h1:4Xr3D9pyjzxK/EnJooy9an/7jGXMhPCF2t+/O4GzDwQ=
github.com/elastic/mito v1.21.0/go.mod h1:h1V+8B62+DXsu0TstJkjsTh5ewJIDJlwzxPkP3HBM9s=
github.com/elastic/mito v1.22.0 h1:DW4RkO+PLwSbKVF5ijYzi0ug+TKzLL+DVJRzbOPbzQ0=
github.com/elastic/mito v1.22.0/go.mod h1:h1V+8B62+DXsu0TstJkjsTh5ewJIDJlwzxPkP3HBM9s=
github.com/elastic/mock-es v0.0.0-20240712014503-e5b47ece0015 h1:z8cC8GASpPo8yKlbnXI36HQ/BM9wYjhBPNbDjAWm0VU=
github.com/elastic/mock-es v0.0.0-20240712014503-e5b47ece0015/go.mod h1:qH9DX/Dmflz6EAtaks/+2SsdQzecVAKE174Zl66hk7E=
github.com/elastic/pkcs8 v1.0.0 h1:HhitlUKxhN288kcNcYkjW6/ouvuwJWd9ioxpjnD9jVA=
Expand Down
2 changes: 2 additions & 0 deletions x-pack/filebeat/input/cel/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"github.com/google/cel-go/cel"
"github.com/google/cel-go/common/decls"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/ext"
"google.golang.org/protobuf/types/known/structpb"

v2 "github.com/elastic/beats/v7/filebeat/input/v2"
Expand Down Expand Up @@ -98,7 +99,7 @@
func (input) Name() string { return inputName }

func (input) Test(src inputcursor.Source, _ v2.TestContext) error {
cfg := src.(*source).cfg

Check failure on line 102 in x-pack/filebeat/input/cel/input.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value is not checked (errcheck)
if !wantClient(cfg) {
return nil
}
Expand All @@ -118,7 +119,7 @@
}
}

err := input{}.run(env, src.(*source), cursor, pub)

Check failure on line 122 in x-pack/filebeat/input/cel/input.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value is not checked (errcheck)
if err != nil {
env.UpdateStatus(status.Failed, "failed to run: "+err.Error())
return err
Expand Down Expand Up @@ -1063,6 +1064,7 @@
opts := []cel.EnvOption{
cel.VariableDecls(decls.NewVariable(root, types.DynType)),
cel.OptionalTypes(cel.OptionalTypesVersion(lib.OptionalTypesVersion)),
ext.TwoVarComprehensions(ext.TwoVarComprehensionsVersion(lib.OptionalTypesVersion)),
lib.AWS(),
lib.Collections(),
lib.Crypto(),
Expand Down
34 changes: 34 additions & 0 deletions x-pack/filebeat/input/cel/input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,40 @@
{"message": "AWS4-HMAC-SHA256 Credential=id/20091110/region/service/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-security-token, Signature=ad27046c0009e06c6626e6009ba2af96027f4893b7a190ab67aaec85becb25cd"},
},
},
{
// This test exists purely to demonstrate that the lib is available.
name: "optional_types_v2",
config: map[string]interface{}{
"interval": 1,
"program": `{"events": [{
"message": optional.unwrap([optional.of(42), optional.none()]).encode_json(),
}]}`,
"state": nil,
"resource": map[string]interface{}{
"url": "",
},
},
want: []map[string]interface{}{
{"message": "[42]"},
},
},
{
// This test exists purely to demonstrate that the lib is available.
name: "two_var_comprehension_v2",
config: map[string]interface{}{
"interval": 1,
"program": `{"events": [{
"message": {'hello': 'world'}.transformMap(k, v, v + '!').encode_json(),
}]}`,
"state": nil,
"resource": map[string]interface{}{
"url": "",
},
},
want: []map[string]interface{}{
{"message": `{"hello":"world!"}`},
},
},

// FS-based tests.
{
Expand Down Expand Up @@ -579,9 +613,9 @@
</item>
</order>
`
io.ReadAll(r.Body)

Check failure on line 616 in x-pack/filebeat/input/cel/input_test.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value of `io.ReadAll` is not checked (errcheck)
r.Body.Close()
w.Write([]byte(text))

Check failure on line 618 in x-pack/filebeat/input/cel/input_test.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value of `w.Write` is not checked (errcheck)
})
server := httptest.NewServer(r)
config["resource.url"] = server.URL
Expand Down Expand Up @@ -713,7 +747,7 @@
msg = fmt.Sprintf(`{"error":"expected method was %#q"}`, http.MethodGet)
}

w.Write([]byte(msg))

Check failure on line 750 in x-pack/filebeat/input/cel/input_test.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value of `w.Write` is not checked (errcheck)
},
want: []map[string]interface{}{
{
Expand Down Expand Up @@ -761,7 +795,7 @@
msg = fmt.Sprintf(`{"error":"expected method was %#q"}`, http.MethodGet)
}

w.Write([]byte(msg))

Check failure on line 798 in x-pack/filebeat/input/cel/input_test.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value of `w.Write` is not checked (errcheck)
},
want: []map[string]interface{}{
{
Expand Down Expand Up @@ -794,7 +828,7 @@
},
handler: func(w http.ResponseWriter, r *http.Request) {
enc := json.NewEncoder(w)
enc.Encode(map[string][]any{"events": {r.Header.Get("foo")}})

Check failure on line 831 in x-pack/filebeat/input/cel/input_test.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

Error return value of `enc.Encode` is not checked (errcheck)
},
want: []map[string]interface{}{
{
Expand Down Expand Up @@ -1980,7 +2014,7 @@
t.Fatalf("failed to remove failure_dumps directory: %v", err)
}

logp.TestingSetup()

Check failure on line 2017 in x-pack/filebeat/input/cel/input_test.go

View workflow job for this annotation

GitHub Actions / lint (ubuntu-latest)

SA1019: logp.TestingSetup is deprecated: Prefer using localized loggers. Use logptest.NewTestingLogger. (staticcheck)
for _, test := range inputTests {
t.Run(test.name, func(t *testing.T) {
if reason, skip := skipOnWindows[test.name]; runtime.GOOS == "windows" && skip {
Expand Down
Loading