The splunklib.client will be used to connect to Splunk. Naturally, I named the file splunklib.py - due to fighting attempting to have splunklib module work. I probably had my path incorrect.Īnyhow, if you run into this error, the solution for me was to clone the github repo and placed my files in there. Googling this shows the solution is just to install the SDK and follow the documentation. ModuleNotFoundError: No module named 'splunklib' For my Linux enviornment this would not work. If you go to the documentation page here for installation steps, it will suggest using pip or setup.py. So how can we connect to Splunk? Installing the Python SDK You can use the Splunk Enterprise SDK for Python to perform a variety of actions in Splunk Enterprise, including searching data, developing custom UIs, and managing configurations for your instance. This also leads to the Splunk Enterprise SDK for Python The Splunk Developer documentation can be found here.The Splunk SDK github for python can be found here.Splunk license has been changed to a free licence Splunk SDK Some documentation can be found here My home setup I am currently investigating how to make the API remotely accessible.Īdditionally,if this is a prod system, it is best to use Oauth authentication. As such the code will need to be installed and executed locally on the system. If this is a prod system or Splunk Enterprise, the API may not be accessible remotely. Splunk Enterprise, Splunk Free Enterprise, or Splunk Enterprise Installed. Not 100% sure what to do with that yet, but I was thinking some type of trend analysis.Īlso, it was not easy to find the right documentation, so this is my attempt to help others that try this. I have code working that pulls data from Splunk and pushes it into a Google Sheet. Working with Splunk on a day to day basis I thought I might try some ‘automation’. I’ve recently been attempting to automate actions that I do on an everyday basis. Connecting to Splunk without the SDK, using httplib and beautifulsoup.Connecting to Splunk with the Python SDK, executing a search and receiving the results.
0 Comments
Leave a Reply. |