@@ -713,6 +713,10 @@ class Infrastructure(BaseModel):
713
713
web_ui_port : int = Field (default = 8000 , gt = 1 , lt = 65536 , title = "Web UI Port" )
714
714
api_port : int = Field (default = 8089 , gt = 1 , lt = 65536 , title = "REST API Port" )
715
715
instance_name : str = Field (...)
716
+ hec_instance_address : Optional [str ] = Field (
717
+ default = instance_address ,
718
+ description = "HTTP Event Collector Address. Equal to instance_address or Edge Processor Address." ,
719
+ )
716
720
717
721
718
722
class Container (Infrastructure ):
@@ -1260,6 +1264,16 @@ class test_servers(test_common):
1260
1264
"Note that these test_instances may be hosted on the same system, such as localhost/127.0.0.1 or a docker server, or different hosts.\n "
1261
1265
f"This value may also be passed by setting the environment variable [{ TEST_ARGS_ENV } ] with the value above." ,
1262
1266
)
1267
+ hec_server_overrides : Optional [str ] = Field (
1268
+ None ,
1269
+ validate_default = True ,
1270
+ description = "String override servers to use for testing. The list MUST be in the format:\n "
1271
+ "hec_address_override;hec_address_override_2"
1272
+ "\n For example, the following string will use 2 preconfigured hec instances:\n "
1273
+ "127.0.0.1;1.2.3.4\n "
1274
+ "Note that these hec_server_overrides may be hosted on the same system, such as localhost/127.0.0.1 or a docker server or different hosts.\n "
1275
+ "Note that this assumes that Splunk hec token is valid for that server and that the hec port is the same as the hec_port for respective server.\n " ,
1276
+ )
1263
1277
1264
1278
@model_validator (mode = "before" )
1265
1279
@classmethod
@@ -1279,11 +1293,21 @@ def parse_config(cls, data: Any, info: ValidationInfo) -> Any:
1279
1293
1280
1294
infrastructures : List [Infrastructure ] = []
1281
1295
1296
+ split_hec_server_overrides = []
1297
+ hec_server_overrides = data .get ("hec_server_overrides" )
1298
+ if hec_server_overrides :
1299
+ split_hec_server_overrides = hec_server_overrides .split (";" )
1300
+
1282
1301
index = 0
1283
1302
for server in server_info .split (";" ):
1284
1303
address , username , password , web_ui_port , hec_port , api_port = server .split (
1285
1304
","
1286
1305
)
1306
+ hec_address = (
1307
+ split_hec_server_overrides [index ]
1308
+ if len (split_hec_server_overrides ) > index
1309
+ else address
1310
+ )
1287
1311
infrastructures .append (
1288
1312
Infrastructure (
1289
1313
splunk_app_username = username ,
@@ -1293,6 +1317,7 @@ def parse_config(cls, data: Any, info: ValidationInfo) -> Any:
1293
1317
web_ui_port = int (web_ui_port ),
1294
1318
api_port = int (api_port ),
1295
1319
instance_name = f"test_server_{ index } " ,
1320
+ hec_instance_address = hec_address ,
1296
1321
)
1297
1322
)
1298
1323
index += 1
0 commit comments