Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pytest_splunk_addon/sample_generation/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,8 @@ def replace(self, sample, token_count):
url = self.fake.url()

if bool(set(["full", "path"]).intersection(value_list)):
if value_list == ["path"]:
url = ""
url = (
url
+ "/"
Expand All @@ -944,8 +946,9 @@ def replace(self, sample, token_count):
]
)
)

if bool(set(["full", "query"]).intersection(value_list)):
if value_list == ["query"]:
url = ""
url = url + self.generate_url_query_params()
yield self.token_value(*([str(url)] * 2))
else:
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/addons/TA_fiction_indextime/default/props.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ FIELDALIAS-write_ops = w_op_s as write_ops
EVAL-total_ops = read_ops + write_ops
EVAL-vendor_product = if(isnull(vendor_product), "TEST_INDEX_TIME", vendor_product)

[test:indextime:sourcetype_basic]
EVAL-extracted_path = if(match(test_url_path,"^\/.*"), test_url_query, null)
EVAL-extracted_query = if(match(test_url_query,"^\?.*"), test_url_query, null)

[test:indextime:sourcetype:file_all_dependent]
TRANSFORMS-sourcetype_file_all_dependent_change_host = sourcetype_file_all_dependent_change_host

Expand Down
5 changes: 5 additions & 0 deletions tests/e2e/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,11 @@
"*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype:modinput_host_event_time_plugin::modinput_host_event_time_plugin.samples_2* PASSED*",
"*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype:user_email_relation_time_plugin::sample_file_two.samples* PASSED*",
"*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample-file-samples-13* PASSED*",
"*test_splunk_fiction_indextime.py::Test_App::test_props_fields[test:indextime:sourcetype_basic::field::extracted_query* PASSED*",
"*test_splunk_fiction_indextime.py::Test_App::test_props_fields[test:indextime:sourcetype_basic::field::extracted_path* PASSED*",
"*test_splunk_fiction_indextime.py::Test_App::test_props_fields[test:indextime:sourcetype_basic* PASSED*",
"*test_splunk_fiction_indextime.py::Test_App::test_props_fields_no_dash_not_empty[test:indextime:sourcetype_basic::field::extracted_path* PASSED*",
"*test_splunk_fiction_indextime.py::Test_App::test_props_fields_no_dash_not_empty[test:indextime:sourcetype_basic::field::extracted_query* PASSED*",
"*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample-file-samples-14* PASSED*",
"*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample-file-samples-15* PASSED*",
"*test_splunk_fiction_indextime.py::Test_App::test_indextime_key_fields*test:indextime:sourcetype_basic::sample-file-samples-16* PASSED*",
Expand Down