![]() Information hereĪs mentioned above I have the free version, so my credentials are the following: There will not be a Splunk Username and Password screen. ![]() A way to test this, is by going to you Splunk instance via the web browser and it will automatically log in. However, if you have changed the license over to “Free Splunk”, there is technically no authentication. The above credentials will work with Enterprise Splunk and Enterprise Free Splunk. Once running, the code connects, authenticates and replies with the apps installed: connect ( host = HOST, port = PORT, username = USERNAME, password = PASSWORD ) # Print installed apps to the console to verify loginįor app in service. Import splunklib.client as client HOST = "localhost" PORT = 8089 USERNAME = "admin" PASSWORD = "yourpassword" # Create a Service instance and log in This is great to ensure you can connect to the Splunk API. The example code below, will print out the app names. It is also within the Splunk Developer Documentation “How to Connect”, which is what I used to ensure my connection was working. 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
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |