{"id":22399,"library":"splunklib","title":"splunklib","description":"A simple library for performing Splunk search automation. Provides a thin wrapper around Splunk's REST API to execute searches and retrieve results. Current version 1.0.0, released in 2022, with no recent updates.","status":"active","version":"1.0.0","language":"python","source_language":"en","source_url":"https://github.com/IntegralDefense/splunklib","tags":["splunk","search","automation","rest-api"],"install":[{"cmd":"pip install splunklib","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"HTTP client for Splunk REST API","package":"requests","optional":false}],"imports":[{"note":"Wrong package name","wrong":"from splunk import SplunkClient","symbol":"SplunkClient","correct":"from splunklib import SplunkClient"}],"quickstart":{"code":"from splunklib import SplunkClient\n\nclient = SplunkClient(\n    host='splunk.example.com',\n    port=8089,\n    username='admin',\n    password='changeme',\n    scheme='https'\n)\nsearch_query = 'search index=main | head 10'\nresults = client.search(search_query)\nfor result in results:\n    print(result)","lang":"python","description":"Basic example: connect to Splunk, run a search, and print results."},"warnings":[{"fix":"Pass verify=False or configure SSL context.","message":"The library uses urllib3's disable_warnings() by default, which disables SSL certificate verification. Always set verify=False explicitly or handle certificates yourself.","severity":"gotcha","affected_versions":"all"},{"fix":"Use 'splunk.example.com' not 'https://splunk.example.com'.","message":"Server host must not include 'http://' or 'https://' prefix; only the hostname or IP is accepted.","severity":"gotcha","affected_versions":"all"},{"fix":"Use username and password parameters.","message":"The library does not support Splunk authentication tokens; only username/password basic auth.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure you installed splunklib (pip install splunklib) and import from splunklib import SplunkClient.","cause":"Incorrect import or outdated version.","error":"AttributeError: module 'splunklib' has no attribute 'SplunkClient'"},{"fix":"Check host, port, and that Splunk REST API is accessible (default port 8089).","cause":"Splunk server is not reachable or wrong host/port.","error":"ConnectionError: Failed to establish a new connection: [Errno 111] Connection refused"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}