Skip to content

Commit aa3b4a1

Browse files
belimawrmergify[bot]
authored andcommitted
Update journald tests now that Filebeat supports watching folders (#10131)
(cherry picked from commit 5f0f2fd) # Conflicts: # .package-version # NOTICE-fips.txt # NOTICE.txt # go.mod # go.sum # internal/pkg/otel/translate/otelconfig_test.go # testing/integration/k8s/testdata/journald-otel.yml
1 parent 16aa106 commit aa3b4a1

File tree

8 files changed

+166
-7
lines changed

8 files changed

+166
-7
lines changed

.package-version

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
{
2+
<<<<<<< HEAD
23
"version": "8.19.5-SNAPSHOT",
34
"build_id": "8.19.5-98503b30",
45
"manifest_url": "https://snapshots.elastic.co/8.19.5-98503b30/manifest-8.19.5-SNAPSHOT.json",
56
"summary_url": "https://snapshots.elastic.co/8.19.5-98503b30/summary-8.19.5-SNAPSHOT.html",
67
"core_version": "8.19.5",
78
"stack_build_id": "8.19.5-98503b30-SNAPSHOT"
9+
=======
10+
"version": "9.2.0-SNAPSHOT",
11+
"build_id": "9.2.0-b72ad686",
12+
"manifest_url": "https://snapshots.elastic.co/9.2.0-b72ad686/manifest-9.2.0-SNAPSHOT.json",
13+
"summary_url": "https://snapshots.elastic.co/9.2.0-b72ad686/summary-9.2.0-SNAPSHOT.html",
14+
"core_version": "9.2.0",
15+
"stack_build_id": "9.2.0-b72ad686-SNAPSHOT"
16+
>>>>>>> 5f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131))
817
}

NOTICE-fips.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,11 +787,19 @@ Contents of probable licence file $GOMODCACHE/github.com/dolmen-go/contextio@v0.
787787

788788
--------------------------------------------------------------------------------
789789
Dependency : github.com/elastic/beats/v7
790+
<<<<<<< HEAD
790791
Version: v7.0.0-alpha2.0.20250926095803-96df696dc8dc
791792
Licence type (autodetected): Elastic
792793
--------------------------------------------------------------------------------
793794

794795
Contents of probable licence file $GOMODCACHE/github.com/elastic/beats/[email protected]/LICENSE.txt:
796+
=======
797+
Version: v7.0.0-alpha2.0.20250924190604-3dc72030429f
798+
Licence type (autodetected): Elastic
799+
--------------------------------------------------------------------------------
800+
801+
Contents of probable licence file $GOMODCACHE/github.com/elastic/beats/[email protected]/LICENSE.txt:
802+
>>>>>>> 5f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131))
795803

796804
Source code in this repository is variously licensed under the Apache License
797805
Version 2.0, an Apache compatible license, or the Elastic License. Outside of
@@ -18611,11 +18619,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1861118619

1861218620
--------------------------------------------------------------------------------
1861318621
Dependency : golang.org/x/text
18614-
Version: v0.28.0
18622+
Version: v0.29.0
1861518623
Licence type (autodetected): BSD-3-Clause
1861618624
--------------------------------------------------------------------------------
1861718625

18618-
Contents of probable licence file $GOMODCACHE/golang.org/x/text@v0.28.0/LICENSE:
18626+
Contents of probable licence file $GOMODCACHE/golang.org/x/text@v0.29.0/LICENSE:
1861918627

1862018628
Copyright 2009 The Go Authors.
1862118629

NOTICE.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,11 +787,19 @@ Contents of probable licence file $GOMODCACHE/github.com/dolmen-go/contextio@v0.
787787

788788
--------------------------------------------------------------------------------
789789
Dependency : github.com/elastic/beats/v7
790+
<<<<<<< HEAD
790791
Version: v7.0.0-alpha2.0.20250926095803-96df696dc8dc
791792
Licence type (autodetected): Elastic
792793
--------------------------------------------------------------------------------
793794

794795
Contents of probable licence file $GOMODCACHE/github.com/elastic/beats/[email protected]/LICENSE.txt:
796+
=======
797+
Version: v7.0.0-alpha2.0.20250924190604-3dc72030429f
798+
Licence type (autodetected): Elastic
799+
--------------------------------------------------------------------------------
800+
801+
Contents of probable licence file $GOMODCACHE/github.com/elastic/beats/[email protected]/LICENSE.txt:
802+
>>>>>>> 5f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131))
795803

796804
Source code in this repository is variously licensed under the Apache License
797805
Version 2.0, an Apache compatible license, or the Elastic License. Outside of
@@ -19244,11 +19252,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1924419252

1924519253
--------------------------------------------------------------------------------
1924619254
Dependency : golang.org/x/text
19247-
Version: v0.28.0
19255+
Version: v0.29.0
1924819256
Licence type (autodetected): BSD-3-Clause
1924919257
--------------------------------------------------------------------------------
1925019258

19251-
Contents of probable licence file $GOMODCACHE/golang.org/x/text@v0.28.0/LICENSE:
19259+
Contents of probable licence file $GOMODCACHE/golang.org/x/text@v0.29.0/LICENSE:
1925219260

1925319261
Copyright 2009 The Go Authors.
1925419262

go.mod

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ require (
1414
github.com/docker/docker v28.3.3+incompatible
1515
github.com/docker/go-units v0.5.0
1616
github.com/dolmen-go/contextio v0.0.0-20200217195037-68fc5150bcd5
17+
<<<<<<< HEAD
1718
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250926095803-96df696dc8dc
19+
=======
20+
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250924190604-3dc72030429f
21+
>>>>>>> 5f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131))
1822
github.com/elastic/cloud-on-k8s/v2 v2.0.0-20250327073047-b624240832ae
1923
github.com/elastic/elastic-agent-autodiscover v0.10.0
2024
github.com/elastic/elastic-agent-client/v7 v7.17.2
@@ -89,10 +93,17 @@ require (
8993
golang.org/x/exp v0.0.0-20250215185904-eff6e970281f
9094
golang.org/x/mod v0.27.0
9195
golang.org/x/net v0.43.0
96+
<<<<<<< HEAD
9297
golang.org/x/sync v0.16.0
9398
golang.org/x/sys v0.35.0
9499
golang.org/x/term v0.34.0
95100
golang.org/x/text v0.28.0
101+
=======
102+
golang.org/x/sync v0.17.0
103+
golang.org/x/sys v0.36.0
104+
golang.org/x/term v0.35.0
105+
golang.org/x/text v0.29.0
106+
>>>>>>> 5f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131))
96107
golang.org/x/time v0.12.0
97108
golang.org/x/tools v0.36.0
98109
google.golang.org/grpc v1.75.0
@@ -320,8 +331,13 @@ require (
320331
github.com/docker/docker-credential-helpers v0.8.2 // indirect
321332
github.com/docker/go-connections v0.5.0 // indirect
322333
github.com/docker/go-metrics v0.0.1 // indirect
334+
<<<<<<< HEAD
323335
github.com/dop251/goja v0.0.0-20250309171923-bcd7cc6bf64c // indirect
324336
github.com/dop251/goja_nodejs v0.0.0-20171011081505-adff31b136e6 // indirect
337+
=======
338+
github.com/dop251/goja v0.0.0-20250630131328-58d95d85e994 // indirect
339+
github.com/dop251/goja_nodejs v0.0.0-20250409162600-f7acab6894b0 // indirect
340+
>>>>>>> 5f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131))
325341
github.com/dustin/go-humanize v1.0.1 // indirect
326342
github.com/eapache/go-resiliency v1.7.0 // indirect
327343
github.com/eapache/go-xerial-snappy v0.0.0-20230731223053-c322873962e3 // indirect

go.sum

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,13 @@ github.com/elastic/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumpti
483483
github.com/elastic/azure-sdk-for-go/sdk/resourcemanager/consumption/armconsumption v1.1.0-elastic/go.mod h1:0vCBR1wgGwZeGmloJ+eCWIZF2S47grTXRzj2mftg2Nk=
484484
github.com/elastic/bayeux v1.0.5 h1:UceFq01ipmT3S8DzFK+uVAkbCdiPR0Bqei8qIGmUeY0=
485485
github.com/elastic/bayeux v1.0.5/go.mod h1:CSI4iP7qeo5MMlkznGvYKftp8M7qqP/3nzmVZoXHY68=
486+
<<<<<<< HEAD
486487
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250926095803-96df696dc8dc h1:FT1R0QA6slUf37v9Qibb9RXc6D3hBXZYPC1MybVl4mc=
487488
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250926095803-96df696dc8dc/go.mod h1:yFSTlWDwZ+gfnTz2lni5KZPWv0LYWvfjodqULilHOcY=
489+
=======
490+
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250924190604-3dc72030429f h1:A8N/bfbc/kvKOo9gu7JruzAauqMPXDnQ50jwBKAdcyo=
491+
github.com/elastic/beats/v7 v7.0.0-alpha2.0.20250924190604-3dc72030429f/go.mod h1:mxbP+JnIgGEDzOfEK7gNq8v3d6dPC2jzAt4q/QHsnt0=
492+
>>>>>>> 5f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131))
488493
github.com/elastic/cloud-on-k8s/v2 v2.0.0-20250327073047-b624240832ae h1:OiShmbWAyGU0MS0ADJWr1/QgeLIZliMk9xsrFicR3/s=
489494
github.com/elastic/cloud-on-k8s/v2 v2.0.0-20250327073047-b624240832ae/go.mod h1:D2IckZVXARugvikE4fv1glvaJMohKSZRzrPsxCjo9O0=
490495
github.com/elastic/elastic-agent-autodiscover v0.10.0 h1:WJ4zl9uSfk1kHmn2B/0byQBLIL607Zt4LNfOgV7+XN0=
@@ -2049,8 +2054,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
20492054
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
20502055
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
20512056
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
2052-
golang.org/x/text v0.28.0 h1:rhazDwis8INMIwQ4tpjLDzUhx6RlXqZNPEM0huQojng=
2053-
golang.org/x/text v0.28.0/go.mod h1:U8nCwOR8jO/marOQ0QbDiOngZVEBB7MAiitBuMjXiNU=
2057+
golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk=
2058+
golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4=
20542059
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
20552060
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
20562061
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

internal/pkg/otel/translate/otelconfig_test.go

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,16 @@ func TestGetOtelConfig(t *testing.T) {
253253
"logs_dynamic_id": map[string]any{
254254
"enabled": true,
255255
},
256+
<<<<<<< HEAD
256257
"timeout": 90 * time.Second,
257258
"idle_conn_timeout": 3 * time.Second,
258259
},
260+
=======
261+
"auth": map[string]any{
262+
"authenticator": "beatsauth/_agent-component/" + outputName,
263+
},
264+
}
265+
>>>>>>> 5f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131))
259266
}
260267

261268
defaultProcessors := func(streamId, dataset string, namespace string) []any {
@@ -315,6 +322,75 @@ func TestGetOtelConfig(t *testing.T) {
315322
}
316323
}
317324

325+
<<<<<<< HEAD
326+
=======
327+
// expects input id
328+
expectedFilestreamConfig := func(id string) map[string]any {
329+
return map[string]any{
330+
"filebeat": map[string]any{
331+
"inputs": []map[string]any{
332+
{
333+
"id": "test-1",
334+
"type": "filestream",
335+
"data_stream": map[string]any{
336+
"dataset": "generic-1",
337+
},
338+
"paths": []any{
339+
"/var/log/*.log",
340+
},
341+
"index": "logs-generic-1-default",
342+
"processors": defaultProcessors("test-1", "generic-1", "logs"),
343+
},
344+
{
345+
"id": "test-2",
346+
"type": "filestream",
347+
"data_stream": map[string]any{
348+
"dataset": "generic-2",
349+
},
350+
"paths": []any{
351+
"/var/log/*.log",
352+
},
353+
"index": "logs-generic-2-default",
354+
"processors": defaultProcessors("test-2", "generic-2", "logs"),
355+
},
356+
},
357+
},
358+
"output": map[string]any{
359+
"otelconsumer": map[string]any{},
360+
},
361+
"path": map[string]any{
362+
"data": filepath.Join(paths.Run(), id),
363+
},
364+
"queue": map[string]any{
365+
"mem": map[string]any{
366+
"events": uint64(3200),
367+
"flush": map[string]any{
368+
"min_events": uint64(1600),
369+
"timeout": "10s",
370+
},
371+
},
372+
},
373+
"logging": map[string]any{
374+
"with_fields": map[string]any{
375+
"component": map[string]any{
376+
"binary": "filebeat",
377+
"dataset": "elastic_agent.filebeat",
378+
"type": "filestream",
379+
"id": id,
380+
},
381+
"log": map[string]any{
382+
"source": id,
383+
},
384+
},
385+
},
386+
"http": map[string]any{
387+
"enabled": true,
388+
"host": "localhost",
389+
},
390+
}
391+
}
392+
393+
>>>>>>> 5f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131))
318394
getBeatMonitoringConfig := func(_, _ string) map[string]any {
319395
return map[string]any{
320396
"http": map[string]any{

testing/integration/k8s/testdata/journald-input.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ inputs:
1919
streams:
2020
- id: journald-input-id
2121
paths:
22-
- "/opt/journald/*/*"
22+
- "/opt/journald/"
23+
merge: true
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
receivers:
2+
filebeatreceiver:
3+
filebeat:
4+
inputs:
5+
- type: journald
6+
id: journald-input
7+
paths:
8+
- /opt/journal/
9+
merge: true
10+
11+
output:
12+
otelconsumer:
13+
logging:
14+
level: debug
15+
selectors:
16+
- '*'
17+
18+
processors:
19+
resource:
20+
attributes:
21+
- key: data_stream.namespace
22+
action: insert
23+
value: "${EA_POLICY_NAMESPACE}"
24+
25+
exporters:
26+
elasticsearch:
27+
endpoint: "${ES_HOST}"
28+
api_key: "${ES_API_KEY_ENCODED}"
29+
30+
service:
31+
pipelines:
32+
logs:
33+
receivers: [filebeatreceiver]
34+
processors: [resource]
35+
exporters:
36+
- elasticsearch

0 commit comments

Comments
 (0)