Skip to content

Commit d9492f5

Browse files
Merge branch 'master' into feature/improve_logging
2 parents ca3d9eb + 3338cac commit d9492f5

File tree

92 files changed

+1524
-2849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1524
-2849
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Build package
2020
run: python setup.py sdist
2121
- name: Publish package to PyPI
22-
uses: pypa/gh-action-pypi-publish@v1.8.8
22+
uses: pypa/gh-action-pypi-publish@v1.8.10
2323
with:
2424
user: __token__
2525
password: ${{ secrets.pypi_password }}

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
os:
1313
- ubuntu-latest
14-
python: [3.7]
14+
python: [ 3.7, 3.9]
1515
splunk-version:
1616
- "8.1"
1717
- "8.2"

CHANGELOG.md

Lines changed: 46 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,36 @@
11
# Splunk Enterprise SDK for Python Changelog
22

3+
## Version 2.0.1
4+
5+
### Bug fixes
6+
* [#567](https://github.com/splunk/splunk-sdk-python/issues/567) Moved "deprecation" dependency
7+
8+
9+
## Version 2.0.0
10+
11+
### Feature updates
12+
* `ensure_binary`, `ensure_str` and `assert_regex` utility methods have been migrated from `six.py` to `splunklib/utils.py`
13+
14+
### Major changes
15+
* Removed code specific to Python 2
16+
* Removed six.py dependency
17+
* Removed `__future__` imports
18+
* Refactored and Updated `splunklib` and `tests` to utilize Python 3 features
19+
* Updated CI test matrix to run with Python versions - 3.7 and 3.9
20+
* Refactored Code throwing `deprecation` warnings
21+
* Refactored Code violating Pylint rules
22+
23+
### Bug fixes
24+
* [#527](https://github.com/splunk/splunk-sdk-python/issues/527) Added check for user roles
25+
* Fix to access the metadata "finished" field in search commands using the v2 protocol
26+
* Fix for error messages about ChunkedExternProcessor in splunkd.log for Custom Search Commands
27+
28+
329
## Version 1.7.4
430

531
### Bug fixes
6-
* [#532](https://github.com/splunk/splunk-sdk-python/pull/532) update encoding errors mode to 'replace' [[issue#505](https://github.com/splunk/splunk-sdk-python/issues/505)]
7-
* [#507](https://github.com/splunk/splunk-sdk-python/pull/507) masked sensitive data in logs [[issue#506](https://github.com/splunk/splunk-sdk-python/issues/506)]
32+
* [#532](https://github.com/splunk/splunk-sdk-python/pull/532) Update encoding errors mode to 'replace' [[issue#505](https://github.com/splunk/splunk-sdk-python/issues/505)]
33+
* [#507](https://github.com/splunk/splunk-sdk-python/pull/507) Masked sensitive data in logs [[issue#506](https://github.com/splunk/splunk-sdk-python/issues/506)]
834

935
### Minor changes
1036
* [#530](https://github.com/splunk/splunk-sdk-python/pull/530) Update GitHub CI build status in README and removed RTD(Read The Docs) reference
@@ -35,7 +61,7 @@
3561
* [#471](https://github.com/splunk/splunk-sdk-python/pull/471) Fixed support of Load Balancer "sticky sessions" (persistent cookies) [[issue#438](https://github.com/splunk/splunk-sdk-python/issues/438)]
3662

3763
### Minor changes
38-
* [#466](https://github.com/splunk/splunk-sdk-python/pull/466) tests for CSC apps
64+
* [#466](https://github.com/splunk/splunk-sdk-python/pull/466) Tests for CSC apps
3965
* [#467](https://github.com/splunk/splunk-sdk-python/pull/467) Added 'kwargs' parameter for Saved Search History function
4066
* [#475](https://github.com/splunk/splunk-sdk-python/pull/475) README updates
4167

@@ -45,10 +71,10 @@
4571
* [#468](https://github.com/splunk/splunk-sdk-python/pull/468) SDK Support for splunkd search API changes
4672

4773
### Bug fixes
48-
* [#464](https://github.com/splunk/splunk-sdk-python/pull/464) updated checks for wildcards in StoragePasswords [[issue#458](https://github.com/splunk/splunk-sdk-python/issues/458)]
74+
* [#464](https://github.com/splunk/splunk-sdk-python/pull/464) Updated checks for wildcards in StoragePasswords [[issue#458](https://github.com/splunk/splunk-sdk-python/issues/458)]
4975

5076
### Minor changes
51-
* [#463](https://github.com/splunk/splunk-sdk-python/pull/463) Preserve thirdparty cookies
77+
* [#463](https://github.com/splunk/splunk-sdk-python/pull/463) Preserve third-party cookies
5278

5379
## Version 1.6.20
5480

@@ -74,7 +100,7 @@
74100
* Pre-requisite: Query parameter 'output_mode' must be set to 'json'
75101
* Improves performance by approx ~80-90%
76102
* ResultsReader is deprecated and will be removed in future releases (NOTE: Please migrate to JSONResultsReader)
77-
* [#437](https://github.com/splunk/splunk-sdk-python/pull/437) added setup_logging() method in splunklib for logging
103+
* [#437](https://github.com/splunk/splunk-sdk-python/pull/437) Added setup_logging() method in splunklib for logging
78104
* [#426](https://github.com/splunk/splunk-sdk-python/pull/426) Added new github_commit modular input example
79105
* [#392](https://github.com/splunk/splunk-sdk-python/pull/392) Break out search argument to option parsing for v2 custom search commands
80106
* [#384](https://github.com/splunk/splunk-sdk-python/pull/384) Added Float parameter validator for custom search commands
@@ -90,17 +116,17 @@
90116
### Minor changes
91117
* [#440](https://github.com/splunk/splunk-sdk-python/pull/440) Github release workflow modified to generate docs
92118
* [#430](https://github.com/splunk/splunk-sdk-python/pull/430) Fix indentation in README
93-
* [#429](https://github.com/splunk/splunk-sdk-python/pull/429) documented how to access modular input metadata
119+
* [#429](https://github.com/splunk/splunk-sdk-python/pull/429) Documented how to access modular input metadata
94120
* [#427](https://github.com/splunk/splunk-sdk-python/pull/427) Replace .splunkrc with .env file in test and examples
95121
* [#424](https://github.com/splunk/splunk-sdk-python/pull/424) Float validator test fix
96-
* [#423](https://github.com/splunk/splunk-sdk-python/pull/423) Python3 compatibility for ResponseReader.__str__()
122+
* [#423](https://github.com/splunk/splunk-sdk-python/pull/423) Python 3 compatibility for ResponseReader.__str__()
97123
* [#422](https://github.com/splunk/splunk-sdk-python/pull/422) ordereddict and all its reference removed
98124
* [#421](https://github.com/splunk/splunk-sdk-python/pull/421) Update README.md
99125
* [#387](https://github.com/splunk/splunk-sdk-python/pull/387) Update filter.py
100126
* [#331](https://github.com/splunk/splunk-sdk-python/pull/331) Fix a couple of warnings spotted when running python 2.7 tests
101127
* [#330](https://github.com/splunk/splunk-sdk-python/pull/330) client: use six.string_types instead of basestring
102128
* [#329](https://github.com/splunk/splunk-sdk-python/pull/329) client: remove outdated comment in Index.submit
103-
* [#262](https://github.com/splunk/splunk-sdk-python/pull/262) properly add parameters to request based on the method of the request
129+
* [#262](https://github.com/splunk/splunk-sdk-python/pull/262) Properly add parameters to request based on the method of the request
104130
* [#237](https://github.com/splunk/splunk-sdk-python/pull/237) Don't output close tags if you haven't written a start tag
105131
* [#149](https://github.com/splunk/splunk-sdk-python/pull/149) "handlers" stanza missing in examples/searchcommands_template/default/logging.conf
106132

@@ -170,7 +196,7 @@ https://github.com/splunk/splunk-sdk-python/blob/develop/README.md#customization
170196
* Fixed regression in mod inputs which resulted in error ’file' object has no attribute 'readable’, by not forcing to text/bytes in mod inputs event writer any longer.
171197

172198
### Minor changes
173-
* Minor updates to the splunklib search commands to support Python3
199+
* Minor updates to the splunklib search commands to support Python 3
174200

175201
## Version 1.6.12
176202

@@ -179,32 +205,32 @@ https://github.com/splunk/splunk-sdk-python/blob/develop/README.md#customization
179205
* Made modinput text consistent
180206

181207
### Bug fixes
182-
* Changed permissions from 755 to 644 for python files to pass appinspect checks
208+
* Changed permissions from 755 to 644 for Python files to pass Appinspect checks
183209
* Removed version check on ssl verify toggle
184210

185211
## Version 1.6.11
186212

187213
### Bug Fix
188214

189-
* Fix custom search command V2 failures on Windows for Python3
215+
* Fix custom search command V2 failures on Windows for Python 3
190216

191217
## Version 1.6.10
192218

193219
### Bug Fix
194220

195-
* Fix long type gets wrong values on windows for python 2
221+
* Fix long type gets wrong values on Windows for Python 2
196222

197223
## Version 1.6.9
198224

199225
### Bug Fix
200226

201-
* Fix buffered input in python 3
227+
* Fix buffered input in Python 3
202228

203229
## Version 1.6.8
204230

205231
### Bug Fix
206232

207-
* Fix custom search command on python 3 on windows
233+
* Fix custom search command on Python 3 on Windows
208234

209235
## Version 1.6.7
210236

@@ -278,7 +304,7 @@ The following bugs have been fixed:
278304

279305
### Minor changes
280306

281-
* Use relative imports throughout the the SDK.
307+
* Use relative imports throughout the SDK.
282308

283309
* Performance improvement when constructing `Input` entity paths.
284310

@@ -417,15 +443,15 @@ The following bugs have been fixed:
417443

418444
* Added a script (GenerateHelloCommand) to the searchcommand_app to generate a custom search command.
419445

420-
* Added a human readable argument titles to modular input examples.
446+
* Added a human-readable argument titles to modular input examples.
421447

422448
* Renamed the searchcommand `csv` module to `splunk_csv`.
423449

424450
### Bug fixes
425451

426452
* Now entities that contain slashes in their name can be created, accessed and deleted correctly.
427453

428-
* Fixed a perfomance issue with connecting to Splunk on Windows.
454+
* Fixed a performance issue with connecting to Splunk on Windows.
429455

430456
* Improved the `service.restart()` function.
431457

@@ -519,7 +545,7 @@ The following bugs have been fixed:
519545
### Bug fixes
520546

521547
* When running `setup.py dist` without running `setup.py build`, there is no
522-
longer an `No such file or directory` error on the command line, and the
548+
longer a `No such file or directory` error on the command line, and the
523549
command behaves as expected.
524550

525551
* When setting the sourcetype of a modular input event, events are indexed
@@ -541,7 +567,7 @@ The following bugs have been fixed:
541567
### Bug fix
542568

543569
* When running `setup.py dist` without running `setup.py build`, there is no
544-
longer an `No such file or directory` error on the command line, and the
570+
longer a `No such file or directory` error on the command line, and the
545571
command behaves as expected.
546572

547573
* When setting the sourcetype of a modular input event, events are indexed properly.

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ docs:
3434
.PHONY: test
3535
test:
3636
@echo "$(ATTN_COLOR)==> test $(NO_COLOR)"
37-
@tox -e py27,py37
37+
@tox -e py37,py39
3838

3939
.PHONY: test_specific
4040
test_specific:
@@ -44,17 +44,17 @@ test_specific:
4444
.PHONY: test_smoke
4545
test_smoke:
4646
@echo "$(ATTN_COLOR)==> test_smoke $(NO_COLOR)"
47-
@tox -e py27,py37 -- -m smoke
47+
@tox -e py37,py39 -- -m smoke
4848

4949
.PHONY: test_no_app
5050
test_no_app:
5151
@echo "$(ATTN_COLOR)==> test_no_app $(NO_COLOR)"
52-
@tox -e py27,py37 -- -m "not app"
52+
@tox -e py37,py39 -- -m "not app"
5353

5454
.PHONY: test_smoke_no_app
5555
test_smoke_no_app:
5656
@echo "$(ATTN_COLOR)==> test_smoke_no_app $(NO_COLOR)"
57-
@tox -e py27,py37 -- -m "smoke and not app"
57+
@tox -e py37,py39 -- -m "smoke and not app"
5858

5959
.PHONY: env
6060
env:

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# The Splunk Enterprise Software Development Kit for Python
66

7-
#### Version 1.7.4
7+
#### Version 2.0.1
88

99
The Splunk Enterprise Software Development Kit (SDK) for Python contains library code designed to enable developers to build applications using the Splunk platform.
1010

@@ -19,19 +19,19 @@ The Splunk developer platform enables developers to take advantage of the same t
1919

2020
## Get started with the Splunk Enterprise SDK for Python
2121

22-
The Splunk Enterprise SDK for Python contains library code, and it's examples are located in the [splunk-app-examples](https://github.com/splunk/splunk-app-examples) repository, that show how to programmatically interact with the Splunk platform for a variety of scenarios including searching, saved searches, data inputs, and many more, along with building complete applications.
22+
The Splunk Enterprise SDK for Python contains library code, and its examples are located in the [splunk-app-examples](https://github.com/splunk/splunk-app-examples) repository. They show how to programmatically interact with the Splunk platform for a variety of scenarios including searching, saved searches, data inputs, and many more, along with building complete applications.
2323

2424
### Requirements
2525

2626
Here's what you need to get going with the Splunk Enterprise SDK for Python.
2727

28-
* Python 2.7+ or Python 3.7.
28+
* Python 3.7 or Python 3.9
2929

30-
The Splunk Enterprise SDK for Python has been tested with Python v2.7 and v3.7.
30+
The Splunk Enterprise SDK for Python is compatible with python3 and has been tested with Python v3.7 and v3.9.
3131

32-
* Splunk Enterprise 9.0 or 8.2
32+
* Splunk Enterprise 9.2 or 8.2
3333

34-
The Splunk Enterprise SDK for Python has been tested with Splunk Enterprise 9.0, 8.2 and 8.1
34+
The Splunk Enterprise SDK for Python has been tested with Splunk Enterprise 9.2, 8.2 and 8.1
3535

3636
If you haven't already installed Splunk Enterprise, download it [here](http://www.splunk.com/download).
3737
For more information, see the Splunk Enterprise [_Installation Manual_](https://docs.splunk.com/Documentation/Splunk/latest/Installation).
@@ -61,7 +61,7 @@ Install the sources you cloned from GitHub:
6161
You'll need `docker` and `docker-compose` to get up and running using this method.
6262

6363
```
64-
make up SPLUNK_VERSION=9.0
64+
make up SPLUNK_VERSION=9.2
6565
make wait_up
6666
make test
6767
make down
@@ -110,7 +110,7 @@ here is an example of .env file:
110110
# Access scheme (default: https)
111111
scheme=https
112112
# Your version of Splunk Enterprise
113-
version=9.0
113+
version=9.2
114114
# Bearer token for authentication
115115
#splunkToken=<Bearer-token>
116116
# Session key for authentication

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
# General information about the project.
4545
project = u'Splunk SDK for Python'
46-
copyright = u'2021, Splunk Inc'
46+
copyright = u'2024, Splunk Inc'
4747

4848
# The version info for the project you're documenting, acts as replacement for
4949
# |version| and |release|, also used in various other places throughout the

scripts/build-env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2011-2020 Splunk, Inc.
1+
# Copyright 2011-2024 Splunk, Inc.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License"): you may
44
# not use this file except in compliance with the License. You may obtain

scripts/test_specific.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
echo "To run a specific test:"
2-
echo " tox -e py27,py37 [test_file_path]::[TestClassName]::[test_method]"
2+
echo " tox -e py37,py39 [test_file_path]::[TestClassName]::[test_method]"
33
echo "For Example, To run 'test_autologin' testcase from 'test_service.py' file run"
44
echo " tox -e py37 -- tests/test_service.py::ServiceTestCase::test_autologin"

setup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
#
3-
# Copyright 2011-2015 Splunk, Inc.
3+
# Copyright © 2011-2024 Splunk, Inc.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"): you may
66
# not use this file except in compliance with the License. You may obtain
@@ -24,10 +24,7 @@
2424
failed = False
2525

2626
def run_test_suite():
27-
try:
28-
import unittest2 as unittest
29-
except ImportError:
30-
import unittest
27+
import unittest
3128

3229
def mark_failed():
3330
global failed
@@ -145,6 +142,10 @@ def run(self):
145142
"splunklib.modularinput",
146143
"splunklib.searchcommands"],
147144

145+
install_requires=[
146+
"deprecation",
147+
],
148+
148149
url="http://github.com/splunk/splunk-sdk-python",
149150

150151
version=splunklib.__version__,

sitecustomize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
#
3-
# Copyright 2011-2015 Splunk, Inc.
3+
# Copyright © 2011-2024 Splunk, Inc.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License"): you may
66
# not use this file except in compliance with the License. You may obtain

0 commit comments

Comments
 (0)