55
66#### Version 1.6.12
77
8- The Splunk Software Development Kit (SDK) for Python contains library code and
8+ The Splunk Software Development Kit (SDK) for Python contains library code and
99examples designed to enable developers to build applications using Splunk.
1010
1111Splunk is a search engine and analytic environment that uses a distributed
12- map-reduce architecture to efficiently index, search and process large
12+ map-reduce architecture to efficiently index, search and process large
1313time-varying data sets.
1414
1515The Splunk product is popular with system administrators for aggregation and
@@ -25,31 +25,31 @@ are enabled by Splunk's unique capabilities.
2525## Getting started with the Splunk SDK for Python
2626
2727The Splunk SDK for Python contains library code and examples that show how to
28- programmatically interact with Splunk for a variety of scenarios including
29- searching, saved searches, data inputs, and many more, along with building
30- complete applications.
28+ programmatically interact with Splunk for a variety of scenarios including
29+ searching, saved searches, data inputs, and many more, along with building
30+ complete applications.
3131
3232The information in this Readme provides steps to get going quickly, but for more
33- in-depth information be sure to visit the
34- [ Splunk Developer Portal] ( http://dev.splunk.com/view/SP-CAAAEBB ) .
33+ in-depth information be sure to visit the
34+ [ Splunk Developer Portal] ( http://dev.splunk.com/view/SP-CAAAEBB ) .
3535### Requirements
3636
3737Here's what you need to get going with the Splunk SDK for Python.
3838
3939#### Python
4040
41- The Splunk SDK for Python requires Python 2.7+, including Python 3. The Splunk SDK for Python has been tested with Python v2.7 and v3.5.
41+ The Splunk SDK for Python requires Python 2.7+, including Python 3. The Splunk SDK for Python has been tested with Python v2.7 and v3.5.
4242
4343#### Splunk
4444
45- If you haven't already installed Splunk, download it
46- [ here] ( http://www.splunk.com/download ) . For more about installing and running
47- Splunk and system requirements, see
45+ If you haven't already installed Splunk, download it
46+ [ here] ( http://www.splunk.com/download ) . For more about installing and running
47+ Splunk and system requirements, see
4848[ Installing & Running Splunk] ( http://dev.splunk.com/view/SP-CAAADRV ) . The Splunk SDK for Python has been tested with Splunk Enterprise 7.0 and 7.2.
4949
5050#### Splunk SDK for Python
51- Get the Splunk SDK for Python; [ download the SDK as a ZIP] ( http://dev.splunk.com/view/SP-CAAAEBB )
52- and extract the files. Or, if you want to contribute to the SDK, clone the
51+ Get the Splunk SDK for Python; [ download the SDK as a ZIP] ( http://dev.splunk.com/view/SP-CAAAEBB )
52+ and extract the files. Or, if you want to contribute to the SDK, clone the
5353repository from [ GitHub] ( https://github.com/splunk/splunk-sdk-python ) .
5454
5555
@@ -85,17 +85,17 @@ home folder and are running OS X or Linux, add the following line to your
8585 export PYTHONPATH=~/splunk-sdk-python
8686
8787The SDK command-line examples require a common set of arguments
88- that specify things like the Splunk host, port, and login credentials. For a
89- full list of command-line arguments, include ` --help ` as an argument to any of
90- the examples.
88+ that specify things like the Splunk host, port, and login credentials. For a
89+ full list of command-line arguments, include ` --help ` as an argument to any of
90+ the examples.
9191
9292#### .splunkrc
9393
9494To connect to Splunk, many of the SDK examples and unit tests take command-line
9595arguments that specify values for the host, port, and login credentials for
9696Splunk. For convenience during development, you can store these arguments as
97- key-value pairs in a text file named ** .splunkrc** . Then, the SDK examples and
98- unit tests use the values from the ** .splunkrc** file when you don't specify
97+ key-value pairs in a text file named ** .splunkrc** . Then, the SDK examples and
98+ unit tests use the values from the ** .splunkrc** file when you don't specify
9999them.
100100
101101To use this convenience file, create a text file with the following format:
@@ -115,39 +115,39 @@ To use this convenience file, create a text file with the following format:
115115
116116Save the file as ** .splunkrc** in the current user's home directory.
117117
118- * For example on OS X, save the file as:
118+ * For example on OS X, save the file as:
119119
120120 ~/.splunkrc
121121
122- * On Windows, save the file as:
122+ * On Windows, save the file as:
123123
124124 C:\Users\currentusername\.splunkrc
125125
126126 You might get errors in Windows when you try to name the file because
127127 ".splunkrc" looks like a nameless file with an extension. You can use
128- the command line to create this file&mdash ; go to the
129- ** C:\Users\currentusername** directory and enter the following command:
128+ the command line to create this file&mdash ; go to the
129+ ** C:\Users\currentusername** directory and enter the following command:
130130
131131 Notepad.exe .splunkrc
132132
133133 Click ** Yes** , then continue creating the file.
134134
135- ** Note** : Storing login credentials in the ** .splunkrc** file is only for
136- convenience during development. This file isn't part of the Splunk platform and
137- shouldn't be used for storing user credentials for production. And, if you're
138- at all concerned about the security of your credentials, just enter them at
139- the command line rather than saving them in this file.
135+ ** Note** : Storing login credentials in the ** .splunkrc** file is only for
136+ convenience during development. This file isn't part of the Splunk platform and
137+ shouldn't be used for storing user credentials for production. And, if you're
138+ at all concerned about the security of your credentials, just enter them at
139+ the command line rather than saving them in this file.
140140
141141
142142#### Examples
143143
144- Examples are located in the ** /splunk-sdk-python/examples** directory. To run
145- the examples at the command line, use the Python interpreter and include any
144+ Examples are located in the ** /splunk-sdk-python/examples** directory. To run
145+ the examples at the command line, use the Python interpreter and include any
146146arguments that are required by the example:
147147
148148 python examplename.py --username="admin" --password="changeme"
149149
150- If you saved your login credentials in the ** .splunkrc** file, you can omit
150+ If you saved your login credentials in the ** .splunkrc** file, you can omit
151151those arguments:
152152
153153 python examplename.py
@@ -158,23 +158,36 @@ To get help for an example, use the `--help` argument with an example:
158158
159159#### Unit tests
160160
161- The Splunk SDK for Python contains a collection of unit tests. To run them, open a
161+ The Splunk SDK for Python contains a collection of unit tests. To run them, open a
162162command prompt in the ** /splunk-sdk-python** directory and enter:
163163
164- python setup.py test
164+ make
165165
166- You can also run individual test files, which are located in
167- ** /splunk-sdk-python/tests** . For example, to run the apps test, open a command
168- prompt in the ** /splunk-sdk-python/tests ** subdirectory and enter :
166+ You can also run individual test files, which are located in
167+ ** /splunk-sdk-python/tests** . The following command explains how to run
168+ a specific test :
169169
170- python test_app.py
170+ make test_specific
171171
172- The test suite uses Python's standard library and the built-in ` unittest `
173- library.
172+ The test suite uses Python's standard library, the built-in ` unittest `
173+ library, ` pytest ` , and ` tox ` .
174+
175+ ** Important Notes:**
176+
177+ The test run will fail unless the
178+ [ SDK App Collection] ( https://github.com/splunk/sdk-app-collection ) is installed.
179+
180+ You can exclude app-specific tests with the following command:
181+
182+ make test_no_app
174183
175184You can read more about our testing framework on
176185[ GitHub] ( https://github.com/splunk/splunk-sdk-python/tree/master/tests ) .
177186
187+ In addition, the test run requires the searchcommands app to be built. The ` make `
188+ command runs the tasks to do this, but more complex testing may require you to
189+ rebuild using ` make build_app ` .
190+
178191## Repository
179192
180193<table >
@@ -209,34 +222,34 @@ You can read more about our testing framework on
209222### Changelog
210223
211224The ** CHANGELOG.md** file in the root of the repository contains a description
212- of changes for each version of the SDK. You can also find it online at
225+ of changes for each version of the SDK. You can also find it online at
213226[ https://github.com/splunk/splunk-sdk-python/blob/master/CHANGELOG.md ] ( https://github.com/splunk/splunk-sdk-python/blob/master/CHANGELOG.md ) .
214227
215228### Branches
216229
217230The ** master** branch always represents a stable and released version of the SDK.
218- You can read more about our branching model on our Wiki at
231+ You can read more about our branching model on our Wiki at
219232[ https://github.com/splunk/splunk-sdk-python/wiki/Branching-Model ] ( https://github.com/splunk/splunk-sdk-python/wiki/Branching-Model ) .
220233
221234## Documentation and resources
222- If you need to know more:
235+ If you need to know more:
223236
224- * For all things developer with Splunk, your main resource is the
237+ * For all things developer with Splunk, your main resource is the
225238 [ Splunk Developer Portal] ( http://dev.splunk.com ) .
226239
227- * For conceptual and how-to documentation, see the
240+ * For conceptual and how-to documentation, see the
228241 [ Overview of the Splunk SDK for Python] ( http://dev.splunk.com/view/SP-CAAAEBB ) .
229242
230- * For API reference documentation, see the
243+ * For API reference documentation, see the
231244 [ Splunk SDK for Python Reference] ( http://docs.splunk.com/Documentation/PythonSDK ) .
232245
233- * For more about the Splunk REST API, see the
246+ * For more about the Splunk REST API, see the
234247 [ REST API Reference] ( http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI ) .
235248
236- * For more about about Splunk in general, see
249+ * For more about about Splunk in general, see
237250 [ Splunk>Docs] ( http://docs.splunk.com/Documentation/Splunk ) .
238251
239- * For more about this SDK's repository, see our
252+ * For more about this SDK's repository, see our
240253 [ GitHub Wiki] ( https://github.com/splunk/splunk-sdk-python/wiki/ ) .
241254
242255## Community
@@ -284,24 +297,24 @@ If you would like to contribute to the SDK, go here for more information:
284297
285298### Support
286299
287- 1 . You will be granted support if you or your company are already covered
288- under an existing maintenance/support agreement.
289- Submit a new case in the [ Support Portal] [ contact ] and include "Splunk SDK for Python"
290- in the subject line.
291- 2 . If you are not covered under an existing maintenance/support agreement, you
292- can find help through the broader community at:
293- <ul >
294- <li ><a href =' http://splunk-base.splunk.com/answers/ ' >Splunk Answers</a > (use
295- the <b >sdk</b >, <b >java</b >, <b >python</b >, and <b >javascript</b > tags to
296- identify your questions)</li >
297- </ul >
298- 3 . Splunk will NOT provide support for SDKs if the core library (the
299- code in the <b >/splunklib</b > directory) has been modified. If you modify an
300- SDK and want support, you can find help through the broader community and
301- Splunk answers (see above). We would also like to know why you modified the
302- core library&mdash ; please send feedback to devinfo@splunk.com .
300+ 1 . You will be granted support if you or your company are already covered
301+ under an existing maintenance/support agreement.
302+ Submit a new case in the [ Support Portal] [ contact ] and include "Splunk SDK for Python"
303+ in the subject line.
304+ 2 . If you are not covered under an existing maintenance/support agreement, you
305+ can find help through the broader community at:
306+ <ul >
307+ <li ><a href =' http://splunk-base.splunk.com/answers/ ' >Splunk Answers</a > (use
308+ the <b >sdk</b >, <b >java</b >, <b >python</b >, and <b >javascript</b > tags to
309+ identify your questions)</li >
310+ </ul >
311+ 3 . Splunk will NOT provide support for SDKs if the core library (the
312+ code in the <b >/splunklib</b > directory) has been modified. If you modify an
313+ SDK and want support, you can find help through the broader community and
314+ Splunk answers (see above). We would also like to know why you modified the
315+ core library&mdash ; please send feedback to devinfo@splunk.com .
3033164 . File any issues on [ GitHub] ( https://github.com/splunk/splunk-sdk-python/issues ) .
304-
317+
305318### Contact Us
306319
307320You can [ contact support] [ contact ] if you have Splunk related questions.
0 commit comments