You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-24Lines changed: 22 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,18 +24,18 @@ The Splunk SDK for Python contains library code and examples that show how to pr
24
24
25
25
Here's what you need to get going with the Splunk SDK for Python.
26
26
27
-
####Python
27
+
* Python
28
28
29
-
The Splunk SDK for Python requires Python 2.7+ and Python 3. The Splunk SDK for Python has been tested with Python v2.7 and v3.5.
29
+
The Splunk SDK for Python requires Python 2.7+ and Python 3. The Splunk SDK for Python has been tested with Python v2.7 and v3.5.
30
30
31
-
####Splunk
31
+
* Splunk
32
32
33
-
If you haven't already installed Splunk, download it [here](http://www.splunk.com/download).
34
-
For more information, see the Splunk Enterprise [Installation Manual](https://docs.splunk.com/Documentation/Splunk/latest/Installation).
33
+
If you haven't already installed Splunk, download it [here](http://www.splunk.com/download).
34
+
For more information, see the Splunk Enterprise [_Installation Manual_](https://docs.splunk.com/Documentation/Splunk/latest/Installation).
35
35
36
-
####Splunk SDK for Python
36
+
* Splunk SDK for Python
37
37
38
-
Get the Splunk SDK for Python from [PyPI](https://pypi.org/project/splunk-sdk/). If you want to contribute to the SDK, clone the repository from [GitHub](https://github.com/splunk/splunk-sdk-python).
38
+
Get the Splunk SDK for Python from [PyPI](https://pypi.org/project/splunk-sdk/). If you want to contribute to the SDK, clone the repository from [GitHub](https://github.com/splunk/splunk-sdk-python).
39
39
40
40
41
41
### Install the SDK
@@ -67,10 +67,12 @@ To run the examples and unit tests, you must put the root of the SDK on your PYT
67
67
68
68
The SDK command-line examples require a common set of arguments that specify the host, port, and login credentials for Splunk Enterprise. For a full list of command-line arguments, include `--help` as an argument to any of the examples.
69
69
70
-
#### Convenience file (.splunkrc)
70
+
#### Create a .splunkrc convenience file
71
71
72
72
To connect to Splunk Enterprise, many of the SDK examples and unit tests take command-line arguments that specify values for the host, port, and login credentials for Splunk Enterprise. For convenience during development, you can store these arguments as key-value pairs in a text file named **.splunkrc**. Then, the SDK examples and unit tests use the values from the **.splunkrc** file when you don't specify them.
73
73
74
+
>**Note**: Storing login credentials in the **.splunkrc** file is only for convenience during development. This file isn't part of the Splunk platform and shouldn't be used for storing user credentials for production. And, if you're at all concerned about the security of your credentials, enter them at the command line rather than saving them in this file.
75
+
74
76
To use this convenience file, create a text file with the following format:
75
77
76
78
# Splunk host (default: localhost)
@@ -102,10 +104,7 @@ Save the file as **.splunkrc** in the current user's home directory.
102
104
103
105
Click **Yes**, then continue creating the file.
104
106
105
-
**Note**: Storing login credentials in the **.splunkrc** file is only for convenience during development. This file isn't part of the Splunk platform and shouldn't be used for storing user credentials for production. And, if you're at all concerned about the security of your credentials, enter them at the command line rather than saving them in this file.
106
-
107
-
108
-
#### Examples
107
+
#### Run the examples
109
108
110
109
Examples are located in the **/splunk-sdk-python/examples** directory. To run the examples at the command line, use the Python interpreter and include any arguments that are required by the example:
111
110
@@ -119,7 +118,7 @@ To get help for an example, use the `--help` argument with an example:
119
118
120
119
python examplename.py --help
121
120
122
-
#### Unit tests
121
+
#### Run the unit tests
123
122
124
123
The Splunk SDK for Python contains a collection of unit tests. To run them, open a command prompt in the **/splunk-sdk-python** directory and enter:
125
124
@@ -131,16 +130,15 @@ You can also run individual test files, which are located in **/splunk-sdk-pytho
131
130
132
131
The test suite uses Python's standard library, the built-in `unittest` library, `pytest`, and `tox`.
133
132
134
-
**Notes:**
135
-
136
-
* The test run fails unless the [SDK App Collection](https://github.com/splunk/sdk-app-collection) app is installed.
137
-
* To exclude app-specific tests, use the following command:
138
-
139
-
make test_no_app
140
-
141
-
* To learn about our testing framework, see [Splunk Test Suite](https://github.com/splunk/splunk-sdk-python/tree/master/tests) on GitHub.
142
-
143
-
In addition, the test run requires you to build the searchcommands app. The `make` command runs the tasks to do this, but more complex testing may require you to rebuild using the `make build_app` command.
133
+
>**Notes:**
134
+
>* The test run fails unless the [SDK App Collection](https://github.com/splunk/sdk-app-collection) app is installed.
135
+
>* To exclude app-specific tests, use the following command:
136
+
>
137
+
> make test_no_app
138
+
>
139
+
>* To learn about our testing framework, see [Splunk Test Suite](https://github.com/splunk/splunk-sdk-python/tree/master/tests) on GitHub.
140
+
>
141
+
> In addition, the test run requires you to build the searchcommands app. The `make` command runs the tasks to do this, but more complex testing may require you to rebuild using the `make build_app` command.
144
142
145
143
## Repository
146
144
@@ -185,7 +183,7 @@ Stay connected with other developers building on the Splunk platform.
185
183
*[Splunk Blogs](https://www.splunk.com/blog)
186
184
*[Twitter](https://twitter.com/splunkdev)
187
185
188
-
### How to contribute
186
+
### Contribute
189
187
190
188
If you would like to contribute to the SDK, see [Contributions to Splunk](https://www.splunk.com/en_us/form/contributions.html).
0 commit comments