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
2 changes: 1 addition & 1 deletion splunklib/searchcommands/search_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def _process_protocol_v2(self, argv, ifile, ofile):
# Write search command configuration for consumption by splunkd
# noinspection PyBroadException
try:
self._record_writer = RecordWriterV2(ofile, getattr(self._metadata, 'maxresultrows', None))
self._record_writer = RecordWriterV2(ofile, getattr(self._metadata.searchinfo, 'maxresultrows', None))
self.fieldnames = []
self.options.reset()

Expand Down
6 changes: 5 additions & 1 deletion tests/searchcommands/test_search_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,9 @@ def test_process_scpv2(self):
'"show_configuration={show_configuration}",'
'"required_option_1=value_1",'
'"required_option_2=value_2"'
']'
'],'
'"maxresultrows": 10,'
'"command": "countmatches"'
'}}'
'}}')

Expand Down Expand Up @@ -472,6 +474,8 @@ def test_process_scpv2(self):
self.assertEqual(command_metadata.searchinfo.splunk_version, '20150522')
self.assertEqual(command_metadata.searchinfo.splunkd_uri, 'https://127.0.0.1:8089')
self.assertEqual(command_metadata.searchinfo.username, 'admin')
self.assertEqual(command_metadata.searchinfo.maxresultrows, 10)
self.assertEqual(command_metadata.searchinfo.command, 'countmatches')

command.search_results_info.search_metrics = command.search_results_info.search_metrics.__dict__
command.search_results_info.optional_fields_json = command.search_results_info.optional_fields_json.__dict__
Expand Down