diff --git a/CHANGELOG.next.asciidoc b/CHANGELOG.next.asciidoc index a0d6239609fa..e781ae78b2fd 100644 --- a/CHANGELOG.next.asciidoc +++ b/CHANGELOG.next.asciidoc @@ -472,6 +472,7 @@ otherwise no tag is added. {issue}42208[42208] {pull}42403[42403] - Segregated `max_workers` from `batch_size` in the azure-blob-storage input. {issue}44491[44491] {pull}44992[44992] - Add support for relationship expansion to EntraID entity analytics provider. {issue}43324[43324] {pull}44761[44761] - Update CEL mito extensions to v1.21.0. {issue}40762[40762] {pull}45107[45107] +- Update CEL mito extensions to v1.22.0. {pull}45245[45245] *Auditbeat* diff --git a/NOTICE.txt b/NOTICE.txt index 4ddcaa98220a..cda1612cee94 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -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 diff --git a/docs/reference/filebeat/filebeat-input-cel.md b/docs/reference/filebeat/filebeat-input-cel.md index a85ff352c02f..3531e8d18016 100644 --- a/docs/reference/filebeat/filebeat-input-cel.md +++ b/docs/reference/filebeat/filebeat-input-cel.md @@ -117,7 +117,7 @@ After completion of a program’s execution it should return a single object wit 1. The `events` field must be present, but may be empty or null. If it is not empty, it must only have objects as elements. The field should be an array, but in the case of an error condition in the CEL program it is acceptable to return a single object instead of an array; this will will be wrapped as an array for publication and an error will be logged. If the single object contains a key, "error", the error value will be used to update the status of the input to report to Elastic Agent. This can be used to more rapidly respond to API failures. 2. If `cursor` is present it must be either be a single object or an array with the same length as events; each element *i* of the `cursor` will be the details for obtaining the events at and beyond event *i* in the `events` array. If the `cursor` is a single object it is will be the details for obtaining events after the last event in the `events` array and will only be retained on successful publication of all the events in the `events` array. -3. If `rate_limit` is present it must be a map with numeric fields `rate` and `burst`. The `rate_limit` field may also have a string `error` field and other fields which will be logged. If it has an `error` field, the `rate` and `burst` will not be used to set rate limit behavior. The [Limit](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#Limit), and [Okta Rate Limit policy](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#OktaRateLimit) and [Draft Rate Limit policy](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#DraftRateLimit) documentation show how to construct this field. +3. If `rate_limit` is present it must be a map with numeric fields `rate` and `burst`. The `rate_limit` field may also have a string `error` field and other fields which will be logged. If it has an `error` field, the `rate` and `burst` will not be used to set rate limit behavior. The [Limit](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#Limit), and [Okta Rate Limit policy](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#OktaRateLimit) and [Draft Rate Limit policy](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#DraftRateLimit) documentation show how to construct this field. 4. The evaluation is repeated with the new state, after removing the events field, if the "want_more" field is present and true, and a non-zero events array is returned. If the "want_more" field is present after a failed evaluation, it is set to false. @@ -133,122 +133,122 @@ The CEL input will log the complete state after evaluation when logging at the D As noted above the `cel` input provides functions, macros, and global variables to extend the language. -* [AWS v4 request signing](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#AWS) +* [AWS v4 request signing](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#AWS) * [Sign AWS from env](https://pkg.go.dev/github.com/elastic/mito/lib#hdr-Sign_AWS_from_env-AWS) * [Sign AWS from shared credentials](https://pkg.go.dev/github.com/elastic/mito/lib#hdr-Sign_AWS_from_shared_credentials-AWS) * [Sign AWS from static credentials](https://pkg.go.dev/github.com/elastic/mito/lib#hdr-Sign_AWS_from_static_credentials-AWS) -* [Collections](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#Collections) +* [Collections](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#Collections) - * [Collate](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Collate-Collections) - * [Drop](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Drop-Collections) - * [Drop Empty](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Drop_Empty-Collections) - * [Flatten](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Flatten-Collections) - * [Front](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Front-Collections) - * [Keys](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Keys-Collections) - * [Max](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Max-Collections) - * [Min](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Min-Collections) - * [Sum](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Sum-Collections) - * [Tail](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Tail-Collections) - * [Values](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Values-Collections) - * [With](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-With-Collections) - * [With Replace](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-With_Replace-Collections) - * [With Update](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-With_Update-Collections) - * [Zip](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Zip-Collections) + * [Collate](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Collate-Collections) + * [Drop](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Drop-Collections) + * [Drop Empty](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Drop_Empty-Collections) + * [Flatten](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Flatten-Collections) + * [Front](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Front-Collections) + * [Keys](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Keys-Collections) + * [Max](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Max-Collections) + * [Min](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Min-Collections) + * [Sum](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Sum-Collections) + * [Tail](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Tail-Collections) + * [Values](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Values-Collections) + * [With](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-With-Collections) + * [With Replace](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-With_Replace-Collections) + * [With Update](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-With_Update-Collections) + * [Zip](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Zip-Collections) -* [Crypto](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#Crypto) +* [Crypto](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#Crypto) - * [Base64](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Base64-Crypto) - * [Base64 Decode](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Base64_Decode-Crypto) - * [Base64 Raw](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Base64_Raw-Crypto) - * [Base64 Raw Decode](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Base64_Raw_Decode-Crypto) - * [Hex](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Hex-Crypto) - * [Hex Decode](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Hex_Decode-Crypto) - * [MD5](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-MD5-Crypto) - * [SHA-1](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-SHA_1-Crypto) - * [SHA-256](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-SHA_256-Crypto) - * [HMAC](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-HMAC-Crypto) - * [UUID](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-UUID-Crypto) + * [Base64](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Base64-Crypto) + * [Base64 Decode](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Base64_Decode-Crypto) + * [Base64 Raw](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Base64_Raw-Crypto) + * [Base64 Raw Decode](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Base64_Raw_Decode-Crypto) + * [Hex](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Hex-Crypto) + * [Hex Decode](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Hex_Decode-Crypto) + * [MD5](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-MD5-Crypto) + * [SHA-1](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-SHA_1-Crypto) + * [SHA-256](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-SHA_256-Crypto) + * [HMAC](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-HMAC-Crypto) + * [UUID](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-UUID-Crypto) -* [File](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#File) — the file extension is initialized with MIME handlers for "application/gzip", ["application/x-ndjson"](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#NDJSON), ["application/zip"](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#Zip), ["text/csv; header=absent"](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#CSVNoHeader), and ["text/csv; header=present"](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#CSVHeader). +* [File](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#File) — the file extension is initialized with MIME handlers for "application/gzip", ["application/x-ndjson"](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#NDJSON), ["application/zip"](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#Zip), ["text/csv; header=absent"](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#CSVNoHeader), and ["text/csv; header=present"](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#CSVHeader). - * [Dir](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Dir-File) - * [File](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-File-File) + * [Dir](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Dir-File) + * [File](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-File-File) -* [HTTP](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#HTTP) +* [HTTP](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#HTTP) - * [HEAD](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-HEAD-HTTP) - * [GET](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-GET-HTTP) - * [GET Request](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-GET_Request-HTTP) - * [POST](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-POST-HTTP) - * [POST Request](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-POST_Request-HTTP) - * [Request](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Request-HTTP) - * [Basic Authentication](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Basic_Authentication-HTTP) - * [Do Request](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Do_Request-HTTP) - * [Parse URL](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Parse_URL-HTTP) - * [Format URL](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Format_URL-HTTP) - * [Parse Query](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Parse_Query-HTTP) - * [Format Query](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Format_Query-HTTP) + * [HEAD](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-HEAD-HTTP) + * [GET](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-GET-HTTP) + * [GET Request](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-GET_Request-HTTP) + * [POST](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-POST-HTTP) + * [POST Request](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-POST_Request-HTTP) + * [Request](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Request-HTTP) + * [Basic Authentication](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Basic_Authentication-HTTP) + * [Do Request](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Do_Request-HTTP) + * [Parse URL](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Parse_URL-HTTP) + * [Format URL](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Format_URL-HTTP) + * [Parse Query](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Parse_Query-HTTP) + * [Format Query](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Format_Query-HTTP) -* [JSON](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#JSON) +* [JSON](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#JSON) - * [Encode JSON](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Encode_JSON-JSON) - * [Decode JSON](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Decode_JSON-JSON) - * [Decode JSON Stream](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Decode_JSON_Stream-JSON) + * [Encode JSON](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Encode_JSON-JSON) + * [Decode JSON](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Decode_JSON-JSON) + * [Decode JSON Stream](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Decode_JSON_Stream-JSON) -* [XML](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#XML) — the XML extension is initialized with XML schema definitions provided via the `xsd` configuration option. +* [XML](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#XML) — the XML extension is initialized with XML schema definitions provided via the `xsd` configuration option. - * [Decode XML](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Decode_XML-XML) + * [Decode XML](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Decode_XML-XML) -* [Limit](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#Limit) — the rate limit extension is initialized with [Okta (as "okta")](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#OktaRateLimit) and the [Draft Rate Limit (as "draft")](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#DraftRateLimit) policies. +* [Limit](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#Limit) — the rate limit extension is initialized with [Okta (as "okta")](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#OktaRateLimit) and the [Draft Rate Limit (as "draft")](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#DraftRateLimit) policies. - * [Rate Limit](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Rate_Limit-Limit) + * [Rate Limit](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Rate_Limit-Limit) -* [MIME](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#MIME) — the MIME extension is initialized with MIME handlers for "application/gzip", ["application/x-ndjson"](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#NDJSON), ["application/zip"](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#Zip), ["text/csv; header=absent"](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#CSVNoHeader), and ["text/csv; header=present"](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#CSVHeader). +* [MIME](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#MIME) — the MIME extension is initialized with MIME handlers for "application/gzip", ["application/x-ndjson"](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#NDJSON), ["application/zip"](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#Zip), ["text/csv; header=absent"](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#CSVNoHeader), and ["text/csv; header=present"](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#CSVHeader). - * [MIME](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-MIME-MIME) + * [MIME](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-MIME-MIME) -* [Regexp](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#Regexp) — the regular expression extension is initialized with the patterns specified in the user input configuration via the `regexp` field. +* [Regexp](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#Regexp) — the regular expression extension is initialized with the patterns specified in the user input configuration via the `regexp` field. - * [RE Match](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-RE_Match) - * [RE Find](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-RE_Find) - * [RE Find All](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-RE_Find_All) - * [RE Find Submatch](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-RE_Find_Submatch) - * [RE Find All Submatch](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-RE_Find_All_Submatch) - * [RE Replace All](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-RE_Replace_All) + * [RE Match](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-RE_Match) + * [RE Find](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-RE_Find) + * [RE Find All](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-RE_Find_All) + * [RE Find Submatch](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-RE_Find_Submatch) + * [RE Find All Submatch](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-RE_Find_All_Submatch) + * [RE Replace All](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-RE_Replace_All) -* [Printf](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#Printf) +* [Printf](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#Printf) - * [Sprintf](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Sprintf-Printf) + * [Sprintf](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Sprintf-Printf) -* [Strings](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#Strings) +* [Strings](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#Strings) - * [String Methods](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-String_Methods-Strings) - * [String List Methods](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-String_List_Methods-Strings) - * [Bytes Methods](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Bytes_Methods-Strings) + * [String Methods](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-String_Methods-Strings) + * [String List Methods](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-String_List_Methods-Strings) + * [Bytes Methods](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Bytes_Methods-Strings) -* [Time](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#Time) +* [Time](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#Time) - * [Format](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Format-Time) - * [Parse Time](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Parse_Time-Time) - * [Global Variables](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Global_Variables-Time) + * [Format](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Format-Time) + * [Parse Time](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Parse_Time-Time) + * [Global Variables](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Global_Variables-Time) -* [Try](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#Try) +* [Try](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#Try) - * [Try](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Try-Try) - * [Is Error](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Is_Error-Try) + * [Try](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Try-Try) + * [Is Error](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Is_Error-Try) -* [Debug](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#Debug) — the debug handler registers a logger with the name extension `cel_debug` and calls to the CEL `debug` function are emitted to that logger. +* [Debug](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#Debug) — the debug handler registers a logger with the name extension `cel_debug` and calls to the CEL `debug` function are emitted to that logger. - * [Debug](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#hdr-Debug) + * [Debug](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#hdr-Debug) In addition to the extensions provided in the packages listed above, a global variable `useragent` is also provided which gives the user CEL program access to the filebeat user-agent string. By default, this value is assigned to all requests' user-agent headers unless the CEL program has already set the user-agent header value. Programs wishing to not provide a user-agent, should set this header to the empty string, `""`. Host environment variables are made available via the global map `env`. Only environment variables that have been allow listed via the `allowed_environment` configuration list are visible to the CEL program. -The CEL environment enables the [optional types](https://pkg.go.dev/github.com/google/cel-go/cel#OptionalTypes) library using the version defined [here](https://pkg.go.dev/github.com/elastic/mito@v1.21.0/lib#OptionalTypesVersion). +The CEL environment enables the [optional types](https://pkg.go.dev/github.com/google/cel-go/cel#OptionalTypes) library using the version defined [here](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#OptionalTypesVersion) and the [two-variable comprehensions extensions](https://pkg.go.dev/github.com/google/cel-go/ext#TwoVarComprehensions) library using the version defined [here](https://pkg.go.dev/github.com/elastic/mito@v1.22.0/lib#TwoVarComprehensionVersion). Additionally, it supports authentication via Basic Authentication, Digest Authentication or OAuth2. diff --git a/go.mod b/go.mod index aaf287413b92..a3fbf6949c58 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 407c50b7c693..a01529c83509 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/x-pack/filebeat/input/cel/input.go b/x-pack/filebeat/input/cel/input.go index 6321e2ac7215..e6e580dbe925 100644 --- a/x-pack/filebeat/input/cel/input.go +++ b/x-pack/filebeat/input/cel/input.go @@ -38,6 +38,7 @@ import ( "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" @@ -1063,6 +1064,7 @@ func newProgram(ctx context.Context, src, root string, vars map[string]string, c 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(), diff --git a/x-pack/filebeat/input/cel/input_test.go b/x-pack/filebeat/input/cel/input_test.go index fd398380694b..b73f16414158 100644 --- a/x-pack/filebeat/input/cel/input_test.go +++ b/x-pack/filebeat/input/cel/input_test.go @@ -496,6 +496,40 @@ var inputTests = []struct { {"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. {