splunk / splunk-sdk-python

Splunk Software Development Kit for Python
http://dev.splunk.com
Apache License 2.0
698 stars 370 forks source link

xml.etree.ElementTree.ParseError: syntax error: line 1, column 0 #334

Closed shanmathi1422 closed 2 years ago

shanmathi1422 commented 4 years ago

Hi, I am trying to use export.py from examples directory, to extract data from splunk from particular index. But i am facing the below error, Traceback (most recent call last): File "export.py", line 355, in main() File "export.py", line 330, in main service = connect(*options.kwargs) File "../../splunklib/binding.py", line 1007, in connect c.login() File "../../splunklib/binding.py", line 886, in login session = XML(body).findtext("./sessionKey") File "/python3.7/xml/etree/ElementTree.py", line 1315, in XML parser.feed(text) xml.etree.ElementTree.ParseError: syntax error: line 1, column 0

Python version used: 3.7 Splunk version used: 8.0.4

Kindly do the needful.

rhblind commented 3 years ago

I'm getting the same error as well when trying to login.

akaila-splunk commented 2 years ago

Hi @shanmathi1422 and @rhblind , could you please verify which port and scheme are being set in the .splunkrc file. The connect service works properly when port = 8089 and scheme=https. Please try using the port = 8089 and scheme=https setting in .splunkrc file and let us know if you still face the error

rhblind commented 2 years ago

I'm not using this SDK anymore as it has some other issues we were unable to work around. So I don't have it running any more, sorry =/

ashah-splunk commented 2 years ago

@shanmathi1422 Closing this issue due to no response on it. Please reopen if this is still an issue.