@@ -250,9 +250,16 @@ func TestGetOtelConfig(t *testing.T) {
250
250
"logs_dynamic_id" : map [string ]any {
251
251
"enabled" : true ,
252
252
},
253
+ << << << < HEAD
253
254
"timeout" : 90 * time .Second ,
254
255
"idle_conn_timeout" : 3 * time .Second ,
255
256
},
257
+ == == == =
258
+ "auth" : map [string ]any {
259
+ "authenticator" : "beatsauth/_agent-component/" + outputName ,
260
+ },
261
+ }
262
+ >> >> >> > 5 f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131 ))
256
263
}
257
264
258
265
defaultProcessors := func (streamId , dataset string , namespace string ) []any {
@@ -312,6 +319,75 @@ func TestGetOtelConfig(t *testing.T) {
312
319
}
313
320
}
314
321
322
+ << << << < HEAD
323
+ == == == =
324
+ // expects input id
325
+ expectedFilestreamConfig := func (id string ) map [string ]any {
326
+ return map [string ]any {
327
+ "filebeat" : map [string ]any {
328
+ "inputs" : []map [string ]any {
329
+ {
330
+ "id" : "test-1" ,
331
+ "type" : "filestream" ,
332
+ "data_stream" : map [string ]any {
333
+ "dataset" : "generic-1" ,
334
+ },
335
+ "paths" : []any {
336
+ "/var/log/*.log" ,
337
+ },
338
+ "index" : "logs-generic-1-default" ,
339
+ "processors" : defaultProcessors ("test-1" , "generic-1" , "logs" ),
340
+ },
341
+ {
342
+ "id" : "test-2" ,
343
+ "type" : "filestream" ,
344
+ "data_stream" : map [string ]any {
345
+ "dataset" : "generic-2" ,
346
+ },
347
+ "paths" : []any {
348
+ "/var/log/*.log" ,
349
+ },
350
+ "index" : "logs-generic-2-default" ,
351
+ "processors" : defaultProcessors ("test-2" , "generic-2" , "logs" ),
352
+ },
353
+ },
354
+ },
355
+ "output" : map [string ]any {
356
+ "otelconsumer" : map [string ]any {},
357
+ },
358
+ "path" : map [string ]any {
359
+ "data" : filepath .Join (paths .Run (), id ),
360
+ },
361
+ "queue" : map [string ]any {
362
+ "mem" : map [string ]any {
363
+ "events" : uint64 (3200 ),
364
+ "flush" : map [string ]any {
365
+ "min_events" : uint64 (1600 ),
366
+ "timeout" : "10s" ,
367
+ },
368
+ },
369
+ },
370
+ "logging" : map [string ]any {
371
+ "with_fields" : map [string ]any {
372
+ "component" : map [string ]any {
373
+ "binary" : "filebeat" ,
374
+ "dataset" : "elastic_agent.filebeat" ,
375
+ "type" : "filestream" ,
376
+ "id" : id ,
377
+ },
378
+ "log" : map [string ]any {
379
+ "source" : id ,
380
+ },
381
+ },
382
+ },
383
+ "http" : map [string ]any {
384
+ "enabled" : true ,
385
+ "host" : "localhost" ,
386
+ },
387
+ }
388
+ }
389
+
390
+ >> >> >> > 5 f0f2fd3b (Update journald tests now that Filebeat supports watching folders (#10131 ))
315
391
getBeatMonitoringConfig := func (_ , _ string ) map [string ]any {
316
392
return map [string ]any {
317
393
"http" : map [string ]any {
0 commit comments