@@ -253,9 +253,16 @@ func TestGetOtelConfig(t *testing.T) {
253
253
"logs_dynamic_id" : map [string ]any {
254
254
"enabled" : true ,
255
255
},
256
+ << << << < HEAD
256
257
"timeout" : 90 * time .Second ,
257
258
"idle_conn_timeout" : 3 * time .Second ,
258
259
},
260
+ == == == =
261
+ "auth" : map [string ]any {
262
+ "authenticator" : "beatsauth/_agent-component/" + outputName ,
263
+ },
264
+ }
265
+ >> >> >> > 5 f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131 ))
259
266
}
260
267
261
268
defaultProcessors := func (streamId , dataset string , namespace string ) []any {
@@ -315,6 +322,75 @@ func TestGetOtelConfig(t *testing.T) {
315
322
}
316
323
}
317
324
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
+ >> >> >> > 5 f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131 ))
318
394
getBeatMonitoringConfig := func (_ , _ string ) map [string ]any {
319
395
return map [string ]any {
320
396
"http" : map [string ]any {
0 commit comments