Skip to content

Commit 73e1f1f

Browse files
author
David Noble
committed
Merge branch 'feature/scpv2' of https://git.splunk.com/scm/gitplay/splunk-sdk-python into feature/scpv2
2 parents 7b15748 + 5e1d8d0 commit 73e1f1f

File tree

5 files changed

+20
-8
lines changed

5 files changed

+20
-8
lines changed

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,22 @@
44

55
* Added support for Search Command Protocol V2, for Splunk 6.3+.
66

7-
* Added `splunklib` logger so that command loggers can be configured independently of the `splunklib.searchcommands` module.
7+
* Added support for invoking external search command processes.
8+
9+
See `examples/searchcommands_app/package/bin/pypygeneratext.py`.
10+
11+
* Added a new search command type: EventingCommand is the base class for commands that filter events arriving at a
12+
search head from one or more search peers.
13+
14+
See `examples/searchcommands_app/package/bin/filter.py`.
15+
16+
* Added `splunklib` logger so that command loggers can be configured independently of the `splunklib.searchcommands`
17+
module.
818

919
See `examples/searchcommands_app/package/default/logger.conf` for guidance on logging configuration.
1020

11-
* Added `splunklib.searchcommands.validators.Match` class for verifying that an option value matches a regular expression pattern.
21+
* Added `splunklib.searchcommands.validators.Match` class for verifying that an option value matches a regular
22+
expression pattern.
1223

1324
### Bug fixes
1425

examples/searchcommands_app/package/bin/_pydebug_conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
# under the License.
1616

1717
host = 'localhost'
18-
port = 52001
18+
port = 5678
1919
suspend = False
2020
is_enabled = {}

examples/searchcommands_app/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ def run(self):
455455
os.path.join('package', 'bin', 'countmatches.py'),
456456
os.path.join('package', 'bin', 'filter.py'),
457457
os.path.join('package', 'bin', 'generatehello.py'),
458+
os.path.join('package', 'bin', 'generatetext.py'),
458459
os.path.join('package', 'bin', 'pypygeneratetext.py'),
459460
os.path.join('package', 'bin', 'simulate.py'),
460461
os.path.join('package', 'bin', 'sum.py')

tests/searchcommands/test_search_command.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ def test_process_scpv2(self):
393393

394394
getinfo_metadata = metadata.format(
395395
dispatch_dir=encode_string(dispatch_dir),
396-
logging_configuration=logging_configuration,
396+
logging_configuration=encode_string(logging_configuration)[1:-1],
397397
logging_level=logging_level,
398398
record=('true' if record is True else 'false'),
399399
show_configuration=('true' if show_configuration is True else 'false'))
@@ -407,7 +407,7 @@ def test_process_scpv2(self):
407407

408408
command = TestCommand()
409409
result = StringIO()
410-
argv = ['test.py']
410+
argv = ['some-external-search-command.py']
411411

412412
self.assertEqual(command.logging_configuration, default_logging_configuration)
413413
self.assertEqual(command.logging_level, 'WARNING')
@@ -584,7 +584,7 @@ def test_process_scpv2(self):
584584

585585
getinfo_metadata = metadata.format(
586586
dispatch_dir=encode_string(dispatch_dir),
587-
logging_configuration=logging_configuration,
587+
logging_configuration=encode_string(logging_configuration)[1:-1],
588588
logging_level=logging_level,
589589
record=record,
590590
show_configuration=show_configuration)
@@ -631,7 +631,7 @@ def test_process_scpv2(self):
631631

632632
getinfo_metadata = metadata.format(
633633
dispatch_dir=encode_string(dispatch_dir),
634-
logging_configuration=logging_configuration,
634+
logging_configuration=encode_string(logging_configuration)[1:-1],
635635
logging_level=logging_level,
636636
record=('true' if record is True else 'false'),
637637
show_configuration=('true' if show_configuration is True else 'false'))

tests/searchcommands/test_searchcommands_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ def assertInfoEqual(self, output, expected):
250250
def _get_search_command_path(self, name):
251251
path = os.path.join(
252252
project_root, 'examples', 'searchcommands_app', 'build', 'searchcommands_app', 'bin', name + '.py')
253-
self.assertTrue(path)
253+
self.assertTrue(os.path.isfile(path))
254254
return path
255255

256256
def _run_command(self, name, action=None, phase=None, protocol=2):

0 commit comments

Comments
 (0)