Skip to content

Commit 09551a8

Browse files
committed
Replace .splunkrc with .env file in test and examples
- Replace .spluncrc file with .env in examples and test cases - updated __init__.py and cmdopts classes method to support .env file
1 parent c8fe42c commit 09551a8

Some content is hidden

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

43 files changed

+78
-56
lines changed

.env

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Splunk host (default: localhost)
2+
host=localhost
3+
# Splunk admin port (default: 8089)
4+
port=8089
5+
# Splunk username
6+
username=admin
7+
# Splunk password
8+
password=changed!
9+
# Access scheme (default: https)
10+
scheme=https
11+
# Your version of Splunk (default: 6.2)
12+
version=8.0
13+
# Bearer token for authentication
14+
#bearerToken="<Bearer-token>"
15+
# Session key for authentication
16+
#sessionKey="<Session-Key>"

examples/analytics/input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def main():
102102

103103
argv = sys.argv[1:]
104104

105-
splunk_opts = utils.parse(argv, {}, ".splunkrc", usage=usage)
105+
splunk_opts = utils.parse(argv, {}, ".env", usage=usage)
106106
tracker = AnalyticsTracker("cli_app", splunk_opts.kwargs)
107107

108108
#tracker.track("test_event", "abc123", foo="bar", bar="foo")

examples/analytics/output.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def main():
152152

153153
argv = sys.argv[1:]
154154

155-
opts = utils.parse(argv, {}, ".splunkrc", usage=usage)
155+
opts = utils.parse(argv, {}, ".env", usage=usage)
156156
retriever = AnalyticsRetriever(opts.args[0], opts.kwargs)
157157

158158
#events = retriever.events()

examples/analytics/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def application(name):
146146
def main():
147147
argv = sys.argv[1:]
148148

149-
opts = utils.parse(argv, {}, ".splunkrc")
149+
opts = utils.parse(argv, {}, ".env")
150150
global splunk_opts
151151
splunk_opts = opts.kwargs
152152

examples/async/async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def main(argv):
5151
usage = "async.py <sync | async>"
5252

5353
# Parse the command line args.
54-
opts = parse(argv, {}, ".splunkrc")
54+
opts = parse(argv, {}, ".env")
5555

5656
# We have to see if we got either the "sync" or
5757
# "async" command line arguments.

examples/binding1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def search(self, query, **kwargs):
5252
return self.context.post("search/jobs/export", search=query, **kwargs)
5353

5454
def main(argv):
55-
opts = parse(argv, {}, ".splunkrc")
55+
opts = parse(argv, {}, ".env")
5656
context = connect(**opts.kwargs)
5757
service = Service(context)
5858
assert service.apps().status == 200

examples/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def main():
151151
commands = ['create', 'delete', 'list']
152152

153153
# parse args, connect and setup
154-
opts = parse(argv, {}, ".splunkrc", usage=usage)
154+
opts = parse(argv, {}, ".env", usage=usage)
155155
service = connect(**opts.kwargs)
156156
program = Program(service)
157157

examples/dashboard/feed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def iterate(job):
171171

172172
def main(argv):
173173
# Parse the command line args.
174-
opts = parse(argv, {}, ".splunkrc")
174+
opts = parse(argv, {}, ".env")
175175

176176
# Connect to Splunk
177177
service = client.connect(**opts.kwargs)

examples/event_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"(e.g., export PYTHONPATH=~/splunk-sdk-python.")
3131

3232
def main():
33-
opts = parse(sys.argv[1:], {}, ".splunkrc")
33+
opts = parse(sys.argv[1:], {}, ".env")
3434
service = connect(**opts.kwargs)
3535

3636
for item in service.event_types:

examples/explorer/README.md

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)