@@ -713,6 +713,10 @@ class Infrastructure(BaseModel):
713713 web_ui_port : int = Field (default = 8000 , gt = 1 , lt = 65536 , title = "Web UI Port" )
714714 api_port : int = Field (default = 8089 , gt = 1 , lt = 65536 , title = "REST API Port" )
715715 instance_name : str = Field (...)
716+ hec_instance_address : Optional [str ] = Field (
717+ default = None ,
718+ description = "HTTP Event Collector Address. May be Edge Processor Address, if not provided instance_address will used." ,
719+ )
716720
717721
718722class Container (Infrastructure ):
@@ -1260,6 +1264,16 @@ class test_servers(test_common):
12601264 "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 "
12611265 f"This value may also be passed by setting the environment variable [{ TEST_ARGS_ENV } ] with the value above." ,
12621266 )
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+ )
12631277
12641278 @model_validator (mode = "before" )
12651279 @classmethod
@@ -1279,11 +1293,21 @@ def parse_config(cls, data: Any, info: ValidationInfo) -> Any:
12791293
12801294 infrastructures : List [Infrastructure ] = []
12811295
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+
12821301 index = 0
12831302 for server in server_info .split (";" ):
12841303 address , username , password , web_ui_port , hec_port , api_port = server .split (
12851304 ","
12861305 )
1306+ hec_address = (
1307+ split_hec_server_overrides [index ]
1308+ if len (split_hec_server_overrides ) > index
1309+ else address
1310+ )
12871311 infrastructures .append (
12881312 Infrastructure (
12891313 splunk_app_username = username ,
@@ -1293,6 +1317,7 @@ def parse_config(cls, data: Any, info: ValidationInfo) -> Any:
12931317 web_ui_port = int (web_ui_port ),
12941318 api_port = int (api_port ),
12951319 instance_name = f"test_server_{ index } " ,
1320+ hec_instance_address = hec_address ,
12961321 )
12971322 )
12981323 index += 1
0 commit comments