All Apps and Add-ons

RSS Scripted Input - Python Error

vasuparvatham
New Member

I have installed a free version of Splunk and installed RSS Scripted Input as per the README document.

rssfeed2.py file has

base_url = 'https://localhost:8089'
username = 'administrator'
password = 'administrator'
earliest = 'earliest=-24h'

f = open(sys.argv[1], 'r')

Login and get the session key

request = urllib2.Request(base_url + '/servicesNS/admin/search/auth/login',
data = urllib.urlencode({username: 'administrator', password: 'administrator'}))
server_content = urllib2.urlopen(request)
session_key = minidom.parseString(server_content.read()).getElementsByTagName('sessionKey')[0].childNodes[0].nodeValue

I am getting different errors upon correcting this line:
data = urllib.urlencode({username: 'administrator', password: 'administrator'}))

like:

1) data = urllib.urlencode({'username': 'administrator', 'password': 'administrator'}))
2) data = urllib.urlencode({username: 'administrator', password: 'administrator'}))

Can you please correct me what's wrong here?

0 Karma

vasuparvatham
New Member

I tried removing base_url and by giving complete URL in the urllib2.Request itself like:

'https://localhost:8089/servicesNS/admin/search/auth/login'

getting python read errors.

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...