Skip to content

Commit b63f4e1

Browse files
mergify[bot]efd6
andauthored
[8.18](backport #44098) mod: update github.com/elastic/mito to v1.19.0 (#44128)
* mod: update github.com/elastic/mito to v1.19.0 (#44098) Adds: * hex_decode function Also fix links to direct documentation for extension functions. (cherry picked from commit 4c1bf91) # Conflicts: # NOTICE.txt # docs/reference/filebeat/filebeat-input-cel.md # go.mod # go.sum * fix conflicts Includes removal of Markdown doc changes, to be added to asciidoc in next commit. * update asciidoc --------- Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
1 parent cfc68d4 commit b63f4e1

File tree

6 files changed

+90
-77
lines changed

6 files changed

+90
-77
lines changed

CHANGELOG.next.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
124124
- Journald input now works on Docker containers (except Wolfi) {issue}41278[41278] {issue}44040[44040] {pull}44056[44056]
125125
- Fixed websocket input panic on sudden network error or server crash. {issue}44063[44063] {pull}44068[44068]
126126
- [Filestream] Log the "reader closed" message on the debug level to avoid log spam. {pull}44051[44051]
127+
- Fix links to CEL mito extension functions in input documentation. {pull}44098[44098]
127128

128129

129130
*Heartbeat*
@@ -250,6 +251,7 @@ https://github.com/elastic/beats/compare/v8.8.1\...main[Check the HEAD diff]
250251
- Add ability to remove request trace logs from http_endpoint input. {pull}40005[40005]
251252
- Add ability to remove request trace logs from entityanalytics input. {pull}40004[40004]
252253
- Add pagination batch size support to Entity Analytics input's Okta provider. {pull}43655[43655]
254+
- Update CEL mito extensions to v1.19.0. {pull}44098[44098]
253255

254256
*Auditbeat*
255257

NOTICE.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15516,11 +15516,11 @@ limitations under the License.
1551615516

1551715517
--------------------------------------------------------------------------------
1551815518
Dependency : github.com/elastic/mito
15519-
Version: v1.17.0
15519+
Version: v1.19.0
1552015520
Licence type (autodetected): Apache-2.0
1552115521
--------------------------------------------------------------------------------
1552215522

15523-
Contents of probable licence file $GOMODCACHE/github.com/elastic/mito@v1.17.0/LICENSE:
15523+
Contents of probable licence file $GOMODCACHE/github.com/elastic/mito@v1.19.0/LICENSE:
1552415524

1552515525

1552615526
Apache License
@@ -27275,11 +27275,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727527275

2727627276
--------------------------------------------------------------------------------
2727727277
Dependency : golang.org/x/oauth2
27278-
Version: v0.24.0
27278+
Version: v0.27.0
2727927279
Licence type (autodetected): BSD-3-Clause
2728027280
--------------------------------------------------------------------------------
2728127281

27282-
Contents of probable licence file $GOMODCACHE/golang.org/x/oauth2@v0.24.0/LICENSE:
27282+
Contents of probable licence file $GOMODCACHE/golang.org/x/oauth2@v0.27.0/LICENSE:
2728327283

2728427284
Copyright 2009 The Go Authors.
2728527285

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ require (
129129
golang.org/x/crypto v0.36.0
130130
golang.org/x/mod v0.21.0
131131
golang.org/x/net v0.38.0
132-
golang.org/x/oauth2 v0.24.0
132+
golang.org/x/oauth2 v0.27.0
133133
golang.org/x/sync v0.12.0
134134
golang.org/x/sys v0.31.0
135135
golang.org/x/text v0.23.0
@@ -181,7 +181,7 @@ require (
181181
github.com/elastic/go-elasticsearch/v8 v8.17.0
182182
github.com/elastic/go-quark v0.2.0
183183
github.com/elastic/go-sfdc v0.0.0-20241010131323-8e176480d727
184-
github.com/elastic/mito v1.17.0
184+
github.com/elastic/mito v1.19.0
185185
github.com/elastic/mock-es v0.0.0-20240712014503-e5b47ece0015
186186
github.com/elastic/sarama v1.19.1-0.20241120141909-c7eabfcee7e5
187187
github.com/elastic/tk-btf v0.1.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,8 +380,8 @@ github.com/elastic/gopacket v1.1.20-0.20241002174017-e8c5fda595e6 h1:VgOx6omXIMK
380380
github.com/elastic/gopacket v1.1.20-0.20241002174017-e8c5fda595e6/go.mod h1:riddUzxTSBpJXk3qBHtYr4qOhFhT6k/1c0E3qkQjQpA=
381381
github.com/elastic/gosigar v0.14.3 h1:xwkKwPia+hSfg9GqrCUKYdId102m9qTJIIr7egmK/uo=
382382
github.com/elastic/gosigar v0.14.3/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs=
383-
github.com/elastic/mito v1.17.0 h1:UEEFfQy5WhS6vVvMPMwHvdn5rH24eBJMb2ZOlGBkI5s=
384-
github.com/elastic/mito v1.17.0/go.mod h1:nG5MoOsgJwVlglhlANiBFmHWqoIjrpbR5vy612wE8yE=
383+
github.com/elastic/mito v1.19.0 h1:rrJ8GR6SniJ/KieB5j8kDTNf5vAIJOtKiAz4hcfP1LU=
384+
github.com/elastic/mito v1.19.0/go.mod h1:f+W7LJ18FGwjVGmbXlOLVYsAbuVAtqqMkgdh0Sf00W0=
385385
github.com/elastic/mock-es v0.0.0-20240712014503-e5b47ece0015 h1:z8cC8GASpPo8yKlbnXI36HQ/BM9wYjhBPNbDjAWm0VU=
386386
github.com/elastic/mock-es v0.0.0-20240712014503-e5b47ece0015/go.mod h1:qH9DX/Dmflz6EAtaks/+2SsdQzecVAKE174Zl66hk7E=
387387
github.com/elastic/pkcs8 v1.0.0 h1:HhitlUKxhN288kcNcYkjW6/ouvuwJWd9ioxpjnD9jVA=
@@ -1188,8 +1188,8 @@ golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
11881188
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
11891189
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
11901190
golang.org/x/oauth2 v0.0.0-20190130055435-99b60b757ec1/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
1191-
golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE=
1192-
golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
1191+
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
1192+
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
11931193
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
11941194
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
11951195
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

x-pack/filebeat/docs/inputs/input-cel.asciidoc

Lines changed: 64 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[role="xpack"]
22

33
:type: cel
4-
:mito_version: v1.17.0
4+
:mito_version: v1.19.0
55
:mito_docs: https://pkg.go.dev/github.com/elastic/mito@{mito_version}
66

77
[id="{beatname_lc}-input-{type}"]
@@ -156,97 +156,94 @@ See <<cel-state-redact,`redact`>> configuration parameters for settings to exclu
156156
As noted above the `cel` input provides functions, macros, and global variables to extend the language.
157157

158158
* {mito_docs}/lib#Collections[Collections]
159-
** {mito_docs}/lib#hdr-Collate[Collate]
160-
** {mito_docs}/lib#hdr-Drop[Drop]
161-
** {mito_docs}/lib#hdr-Drop_Empty[Drop Empty]
162-
** {mito_docs}/lib#hdr-Flatten[Flatten]
163-
** {mito_docs}/lib#hdr-Front[Front]
164-
** {mito_docs}/lib#hdr-Keys[Keys]
165-
** {mito_docs}/lib#hdr-Max[Max]
166-
** {mito_docs}/lib#hdr-Min[Min]
167-
** {mito_docs}/lib#hdr-Sum[Sum]
168-
** {mito_docs}/lib#hdr-Tail[Tail]
169-
** {mito_docs}/lib#hdr-Values[Values]
170-
** {mito_docs}/lib#hdr-With[With]
171-
** {mito_docs}/lib#hdr-With_Replace[With Replace]
172-
** {mito_docs}/lib#hdr-With_Update[With Update]
173-
** {mito_docs}/lib#hdr-Zip[Zip]
159+
** {mito_docs}/lib#hdr-Collate-Collections[Collate]
160+
** {mito_docs}/lib#hdr-Drop-Collections[Drop]
161+
** {mito_docs}/lib#hdr-Drop_Empty-Collections[Drop Empty]
162+
** {mito_docs}/lib#hdr-Flatten-Collections[Flatten]
163+
** {mito_docs}/lib#hdr-Front-Collections[Front]
164+
** {mito_docs}/lib#hdr-Keys-Collections[Keys]
165+
** {mito_docs}/lib#hdr-Max-Collections[Max]
166+
** {mito_docs}/lib#hdr-Min-Collections[Min]
167+
** {mito_docs}/lib#hdr-Sum-Collections[Sum]
168+
** {mito_docs}/lib#hdr-Tail-Collections[Tail]
169+
** {mito_docs}/lib#hdr-Values-Collections[Values]
170+
** {mito_docs}/lib#hdr-With-Collections[With]
171+
** {mito_docs}/lib#hdr-With_Replace-Collections[With Replace]
172+
** {mito_docs}/lib#hdr-With_Update-Collections[With Update]
173+
** {mito_docs}/lib#hdr-Zip-Collections[Zip]
174174

175175
* {mito_docs}/lib#Crypto[Crypto]
176-
** {mito_docs}/lib#hdr-Base64[Base64]
177-
** {mito_docs}/lib#hdr-Base64_Decode[Base64 Decode]
178-
** {mito_docs}/lib#hdr-Base64_Raw[Base64 Raw]
179-
** {mito_docs}/lib#hdr-Base64_Raw_Decode[Base64 Raw Decode]
180-
** {mito_docs}/lib#hdr-Hex[Hex]
181-
** {mito_docs}/lib#hdr-MD5[MD5]
182-
** {mito_docs}/lib#hdr-SHA_1[SHA-1]
183-
** {mito_docs}/lib#hdr-SHA_256[SHA-256]
184-
** {mito_docs}/lib#hdr-HMAC[HMAC]
185-
** {mito_docs}/lib#hdr-UUID[UUID]
186-
187-
* {mito_docs}/lib#File[File]
188-
** {mito_docs}/lib#hdr-Dir[Dir]
189-
** {mito_docs}/lib#hdr-File[File]
190-
191-
* {mito_docs}/lib#HTTP[HTTP]
192-
** {mito_docs}/lib#hdr-HEAD[HEAD]
193-
** {mito_docs}/lib#hdr-GET[GET]
194-
** {mito_docs}/lib#hdr-GET_Request[GET Request]
195-
** {mito_docs}/lib#hdr-POST[POST]
196-
** {mito_docs}/lib#hdr-POST_Request[POST Request]
197-
** {mito_docs}/lib#hdr-Request[Request]
198-
** {mito_docs}/lib#hdr-Basic_Authentication[Basic Authentication]
199-
** {mito_docs}/lib#hdr-Do_Request[Do Request]
200-
** {mito_docs}/lib#hdr-Parse_URL[Parse URL]
201-
** {mito_docs}/lib#hdr-Format_URL[Format URL]
202-
** {mito_docs}/lib#hdr-Parse_Query[Parse Query]
203-
** {mito_docs}/lib#hdr-Format_Query[Format Query]
176+
** {mito_docs}/lib#hdr-Base64-Crypto[Base64]
177+
** {mito_docs}/lib#hdr-Base64_Decode-Crypto[Base64 Decode]
178+
** {mito_docs}/lib#hdr-Base64_Raw-Crypto[Base64 Raw]
179+
** {mito_docs}/lib#hdr-Base64_Raw_Decode-Crypto[Base64 Raw Decode]
180+
** {mito_docs}/lib#hdr-Hex-Crypto[Hex]
181+
** {mito_docs}/lib#hdr-Hex_Decode-Crypto[Hex Decode]
182+
** {mito_docs}/lib#hdr-MD5-Crypto[MD5]
183+
** {mito_docs}/lib#hdr-SHA_1-Crypto[SHA-1]
184+
** {mito_docs}/lib#hdr-SHA_256-Crypto[SHA-256]
185+
** {mito_docs}/lib#hdr-HMAC-Crypto[HMAC]
186+
** {mito_docs}/lib#hdr-UUID-Crypto[UUID]
204187

205188
* {mito_docs}/lib#File[File] — the file extension is initialized with MIME handlers for "application/gzip", {mito_docs}/lib#NDJSON["application/x-ndjson"], {mito_docs}/lib#Zip["application/zip"], {mito_docs}/lib#CSVNoHeader["text/csv; header=absent"], and {mito_docs}/lib#CSVHeader["text/csv; header=present"].
206-
** {mito_docs}/lib#hdr-Dir[Dir]
207-
** {mito_docs}/lib#hdr-File[File]
189+
** {mito_docs}/lib#hdr-Dir-File[Dir]
190+
** {mito_docs}/lib#hdr-File-File[File]
191+
192+
* {mito_docs}/lib#HTTP[HTTP]
193+
** {mito_docs}/lib#hdr-HEAD-HTTP[HEAD]
194+
** {mito_docs}/lib#hdr-GET-HTTP[GET]
195+
** {mito_docs}/lib#hdr-GET_Request-HTTP[GET Request]
196+
** {mito_docs}/lib#hdr-POST-HTTP[POST]
197+
** {mito_docs}/lib#hdr-POST_Request-HTTP[POST Request]
198+
** {mito_docs}/lib#hdr-Request-HTTP[Request]
199+
** {mito_docs}/lib#hdr-Basic_Authentication-HTTP[Basic Authentication]
200+
** {mito_docs}/lib#hdr-Do_Request-HTTP[Do Request]
201+
** {mito_docs}/lib#hdr-Parse_URL-HTTP[Parse URL]
202+
** {mito_docs}/lib#hdr-Format_URL-HTTP[Format URL]
203+
** {mito_docs}/lib#hdr-Parse_Query-HTTP[Parse Query]
204+
** {mito_docs}/lib#hdr-Format_Query-HTTP[Format Query]
208205

209206
* {mito_docs}/lib#JSON[JSON]
210-
** {mito_docs}/lib#hdr-Encode_JSON[Encode JSON]
211-
** {mito_docs}/lib#hdr-Decode_JSON[Decode JSON]
212-
** {mito_docs}/lib#hdr-Decode_JSON_Stream[Decode JSON Stream]
207+
** {mito_docs}/lib#hdr-Encode_JSON-JSON[Encode JSON]
208+
** {mito_docs}/lib#hdr-Decode_JSON-JSON[Decode JSON]
209+
** {mito_docs}/lib#hdr-Decode_JSON_Stream-JSON[Decode JSON Stream]
213210

214211
* {mito_docs}/lib#XML[XML] — the XML extension is initialized with XML schema definitions provided via the `xsd` configuration option.
215-
** {mito_docs}/lib#hdr-Decode_XML[Decode XML]
212+
** {mito_docs}/lib#hdr-Decode_XML-XML[Decode XML]
216213

217214
* {mito_docs}/lib#Limit[Limit] — the rate limit extension is initialized with {mito_docs}/lib#OktaRateLimit[Okta (as "okta")] and the {mito_docs}/lib#DraftRateLimit[Draft Rate Limit (as "draft")] policies.
218-
** {mito_docs}/lib#hdr-Rate_Limit[Rate Limit]
215+
** {mito_docs}/lib#hdr-Rate_Limit-Limit[Rate Limit]
219216

220217
* {mito_docs}/lib#MIME[MIME] — the MIME extension is initialized with MIME handlers for "application/gzip", {mito_docs}/lib#NDJSON["application/x-ndjson"], {mito_docs}/lib#Zip["application/zip"], {mito_docs}/lib#CSVNoHeader["text/csv; header=absent"], and {mito_docs}/lib#CSVHeader["text/csv; header=present"].
221-
** {mito_docs}/lib#hdr-MIME[MIME]
218+
** {mito_docs}/lib#hdr-MIME-MIME[MIME]
222219

223220
* {mito_docs}/lib#Regexp[Regexp] — the regular expression extension is initialized with the patterns specified in the user input configuration via the `regexp` field.
224-
** {mito_docs}/lib#hdr-RE_Match[RE Match]
225-
** {mito_docs}/lib#hdr-RE_Find[RE Find]
226-
** {mito_docs}/lib#hdr-RE_Find_All[RE Find All]
227-
** {mito_docs}/lib#hdr-RE_Find_Submatch[RE Find Submatch]
228-
** {mito_docs}/lib#hdr-RE_Find_All_Submatch[RE Find All Submatch]
229-
** {mito_docs}/lib#hdr-RE_Replace_All[RE Replace All]
221+
** {mito_docs}/lib#hdr-RE_Match-Regexp[RE Match]
222+
** {mito_docs}/lib#hdr-RE_Find-Regexp[RE Find]
223+
** {mito_docs}/lib#hdr-RE_Find_All-Regexp[RE Find All]
224+
** {mito_docs}/lib#hdr-RE_Find_Submatch-Regexp[RE Find Submatch]
225+
** {mito_docs}/lib#hdr-RE_Find_All_Submatch-Regexp[RE Find All Submatch]
226+
** {mito_docs}/lib#hdr-RE_Replace_All-Regexp[RE Replace All]
230227

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

234231
* {mito_docs}/lib#Strings[Strings]
235-
** {mito_docs}/lib#hdr-String_Methods[String Methods]
236-
** {mito_docs}/lib#hdr-String_List_Methods[String List Methods]
237-
** {mito_docs}/lib#hdr-Bytes_Methods[Bytes Methods]
232+
** {mito_docs}/lib#hdr-String_Methods-Strings[String Methods]
233+
** {mito_docs}/lib#hdr-String_List_Methods-Strings[String List Methods]
234+
** {mito_docs}/lib#hdr-Bytes_Methods-Strings[Bytes Methods]
238235

239236
* {mito_docs}/lib#Time[Time]
240-
** {mito_docs}/lib#hdr-Format[Format]
241-
** {mito_docs}/lib#hdr-Parse_Time[Parse Time]
242-
** {mito_docs}/lib#hdr-Global_Variables[Global Variables]
237+
** {mito_docs}/lib#hdr-Format-Time[Format]
238+
** {mito_docs}/lib#hdr-Parse_Time-Time[Parse Time]
239+
** {mito_docs}/lib#hdr-Global_Variables-Time[Global Variables]
243240

244241
* {mito_docs}/lib#Try[Try]
245-
** {mito_docs}/lib#hdr-Try[Try]
246-
** {mito_docs}/lib#hdr-Is_Error[Is Error]
242+
** {mito_docs}/lib#hdr-Try-Try[Try]
243+
** {mito_docs}/lib#hdr-Is_Error-Try[Is Error]
247244

248245
* {mito_docs}/lib#Debug[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.
249-
** {mito_docs}/lib#hdr-Debug[Debug]
246+
** {mito_docs}/lib#hdr-Debug-Debug[Debug]
250247

251248
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 {beatname_lc} 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, `""`.
252249

x-pack/filebeat/input/cel/input_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,20 @@ var inputTests = []struct {
109109
"message": "10",
110110
}},
111111
},
112+
{
113+
name: "hello_world_bytes",
114+
config: map[string]interface{}{
115+
"interval": 1,
116+
"program": `{"events":[{"message":string(hex_decode("68656c6c6f20776f726c64"))}]}`,
117+
"state": nil,
118+
"resource": map[string]interface{}{
119+
"url": "",
120+
},
121+
},
122+
want: []map[string]interface{}{{
123+
"message": "hello world",
124+
}},
125+
},
112126
{
113127
name: "hello_world_front_and_tail_2",
114128
config: map[string]interface{}{

0 commit comments

Comments
 (0)