Skip to content

Commit

Permalink
mod: update elastic/mito to version v1.16.0 (#41727)
Browse files Browse the repository at this point in the history
This brings string formatting and DX improvements.

* sprintf for string formatting
* evaluation failure state dumping
* test coverage support

Wiring for failure dumps and test coverage will come in future changes.
  • Loading branch information
efd6 authored Nov 21, 2024
1 parent 842c411 commit 4dd3bfd
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
- Add support for Journald in the System module. {pull}41555[41555]
- Add ability to remove request trace logs from http_endpoint input. {pull}40005[40005]
- Add ability to remove request trace logs from entityanalytics input. {pull}40004[40004]
- Update CEL mito extensions to v1.16.0. {pull}41727[41727]

*Auditbeat*

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

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

Contents of probable licence file $GOMODCACHE/github.com/elastic/mito@v1.15.0/LICENSE:
Contents of probable licence file $GOMODCACHE/github.com/elastic/mito@v1.16.0/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 @@ -196,7 +196,7 @@ require (
github.com/elastic/go-elasticsearch/v8 v8.14.0
github.com/elastic/go-quark v0.2.0
github.com/elastic/go-sfdc v0.0.0-20241010131323-8e176480d727
github.com/elastic/mito v1.15.0
github.com/elastic/mito v1.16.0
github.com/elastic/mock-es v0.0.0-20240712014503-e5b47ece0015
github.com/elastic/tk-btf v0.1.0
github.com/elastic/toutoumomoma v0.0.0-20240626215117-76e39db18dfb
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,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.15.0 h1:MicOxLSVkgU2Aonbh3i+++66Wl5wvD8y9gALK8PQDYs=
github.com/elastic/mito v1.15.0/go.mod h1:J+wCf4HccW2YoSFmZMGu+d06gN+WmnIlj5ehBqine74=
github.com/elastic/mito v1.16.0 h1:7UYy1OpJ8rlr4nzy/HDYQHuHjUIDMCofk5ICalYC2LA=
github.com/elastic/mito v1.16.0/go.mod h1:J+wCf4HccW2YoSFmZMGu+d06gN+WmnIlj5ehBqine74=
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
5 changes: 4 additions & 1 deletion x-pack/filebeat/docs/inputs/input-cel.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[role="xpack"]

:type: cel
:mito_version: v1.15.0
:mito_version: v1.16.0
:mito_docs: https://pkg.go.dev/github.com/elastic/mito@{mito_version}

[id="{beatname_lc}-input-{type}"]
Expand Down Expand Up @@ -226,6 +226,9 @@ As noted above the `cel` input provides functions, macros, and global variables
** {mito_docs}/lib#hdr-RE_Find_All_Submatch[RE Find All Submatch]
** {mito_docs}/lib#hdr-RE_Replace_All[RE Replace All]

* {mito_docs}/lib#Printf[Printf]
** {mito_docs}/lib#hdr-Sprintf-Printf[Sprintf]

* {mito_docs}/lib#Strings[Strings]
** {mito_docs}/lib#hdr-String_Methods[String Methods]
** {mito_docs}/lib#hdr-String_List_Methods[String List Methods]
Expand Down
1 change: 1 addition & 0 deletions x-pack/filebeat/input/cel/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,7 @@ func newProgram(ctx context.Context, src, root string, vars map[string]string, c
lib.Crypto(),
lib.JSON(nil),
xml,
lib.Printf(),
lib.Strings(),
lib.Time(),
lib.Try(),
Expand Down
14 changes: 14 additions & 0 deletions x-pack/filebeat/input/cel/input_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,20 @@ var inputTests = []struct {
{"message": "Hello, World!"},
},
},
{
name: "hello_world_sprintf",
config: map[string]interface{}{
"interval": 1,
"program": `{"events":[{"message":sprintf("Hello, %s!", ["World"])}]}`,
"state": nil,
"resource": map[string]interface{}{
"url": "",
},
},
want: []map[string]interface{}{
{"message": "Hello, World!"},
},
},
{
name: "hello_world_time",
config: map[string]interface{}{
Expand Down

0 comments on commit 4dd3bfd

Please sign in to comment.