Skip to content

Commit 296084b

Browse files
authored
Merge pull request #404 from splunk/bug/windows_input_ingestion
fix: Extract params before ingestion for windows_input,dbx fix: test name for pytest_expect
2 parents 04cbb06 + 91aeabf commit 296084b

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

pytest_splunk_addon/standard_lib/event_ingestors/requirement_event_ingester.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,27 @@ def get_events(self):
116116
"hec_event",
117117
):
118118
transport_type = "modinput"
119-
LOGGER.info(
120-
"sending data via HEC {}".format(filename)
121-
)
122119
host, source, sourcetype = self.extract_params(
123120
event_tag
124121
)
125122
LOGGER.info(
126-
f"sending data via HEC {host}, {source} {sourcetype}"
123+
f"sending data transport_type:modinput filename:{filename} host:{host}, source:{source} sourcetype:{sourcetype}"
127124
)
128125
elif transport_type == "dbx":
129126
transport_type = "modinput"
127+
host, source, sourcetype = self.extract_params(
128+
event_tag
129+
)
130+
LOGGER.info(
131+
f"sending data transport_type:dbx filename:{filename} host:{host}, source:{source} sourcetype:{sourcetype}"
132+
)
130133
elif transport_type == "windows_input":
131-
transport_type = "windows_input"
134+
host, source, sourcetype = self.extract_params(
135+
event_tag
136+
)
137+
LOGGER.info(
138+
f"sending data transport_type:windows_input filename:{filename} host:{host}, source:{source} sourcetype:{sourcetype}"
139+
)
132140
else:
133141
transport_type = "default"
134142
unescaped_event = self.extract_raw_events(event_tag)

pytest_splunk_addon/standard_lib/requirement_tests/requirement_test_datamodel_tag_constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,5 @@
8282
"Vulnerabilities": ["report", "vulnerability"],
8383
"Web": ["web"],
8484
"Web_Proxy": ["web", "proxy"],
85+
"Data_Access":["data", "access"],
8586
}

pytest_splunk_addon/standard_lib/requirement_tests/test_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def generate_cim_req_params(self):
169169
"modinput_params": modinput_params,
170170
"transport_type": transport_type,
171171
},
172-
id=f"{model_list}::{filename}::event_no::{event_no}::req_test_id::{req_test_id}",
172+
id=f"{(' '.join(model_list))}::{filename}::event_no::{event_no}",
173173
)
174174

175175
def get_models(self, root):

tests/unit/tests_standard_lib/test_requirement_tests/test_test_generator.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ def test_extract_params():
122122
"modinput_params": None,
123123
"transport_type": "syslog",
124124
},
125-
"['model_1:dataset_1',"
126-
" 'model_2:dataset_2']::fake_path/requirement.log"
127-
"::event_no::1::req_test_id::1",
125+
"model_1:dataset_1 "
126+
"model_2:dataset_2::fake_path/requirement.log::event_no::1",
128127
),
129128
],
130129
),

0 commit comments

Comments
 (0)