Splunk
Splunk is a leading platform for searching, monitoring, and analyzing machine-generated data from applications, systems, and infrastructure. It provides real-time insights, powerful search capabilities, and comprehensive monitoring for IT operations, security, and business analytics.
Authentication Types
Splunk supports 1 authentication method:
- API Token - Use Splunk authentication tokens for secure, long-lived API access.
- Pros: Secure, no password exposure, can be easily revoked, supports different permission levels
- Cons: Requires initial setup to generate token
General Settings
Before using the connector, you need to configure:
- Splunk Instance URL - Your Splunk instance URL including the management port (default 8089)
- Splunk Enterprise example:
https://splunk.yourcompany.com:8089 - Splunk Cloud example:
https://yourcompany.splunkcloud.com:8089
- Splunk Enterprise example:
The URL must include the management port (typically 8089) and use HTTPS. Don't include /services in the URL - the connector will add that automatically.
Setting up API Token Authentication
Step 1: Log in to Splunk
- Open your Splunk instance in a web browser
- Log in with your username and password
Step 2: Generate an Authentication Token
For Splunk Enterprise or Splunk Cloud
-
Navigate to Settings > Users and authentication > Tokens
-
Click New Token or Enable Token Authentication if not already enabled
-
Fill in the token details:
- User: Select your username (or the user the token should be associated with)
- Token name: Give it a descriptive name (e.g., "Webrix MCP Connector")
- Audience: Leave as default or specify your Splunk instance
- Expiration: Choose an expiration time or select "Never" for long-lived tokens
-
Click Create
-
Important: Copy the generated token immediately - you won't be able to see it again!
Alternative: Generate Token via REST API
If you prefer to generate a token programmatically:
curl -k -u admin:password https://your-splunk-instance:8089/services/authorization/tokens \
-d name=webrix-token \
-d audience=your-splunk-instance
Step 3: Configure in Webrix
-
In Webrix, navigate to the Splunk connector settings
-
Enter your Splunk Instance URL in General Settings:
- Format:
https://your-instance:8089 - Examples:
- Enterprise:
https://splunk.company.com:8089 - Cloud:
https://company.splunkcloud.com:8089
- Enterprise:
- Format:
-
In the authentication section, paste your API Token
-
Click Save and then Test Connection to verify
Splunk Enterprise vs Splunk Cloud
This connector supports both deployment types:
Splunk Enterprise (On-Premises)
- Use your custom domain and port (typically 8089)
- Ensure the management port is accessible from where Webrix is running
- May require firewall rules or VPN access
- Example URL:
https://splunk.yourcompany.com:8089
Splunk Cloud Platform
- Use your Splunk Cloud URL with port 8089
- Management port may need to be opened via Splunk Support
- Example URL:
https://yourcompany.splunkcloud.com:8089
For Splunk Cloud free trial accounts, REST API access may be restricted. Contact Splunk Support to enable port 8089 access if needed.
Common Use Cases
Running Searches
Use Create Search Job to start a search, then Get Search Job Status to monitor progress, and Get Search Results to retrieve the data:
1. Create Search Job with query: "index=main error | stats count by source"
2. Get Search Job Status with the returned search ID
3. When complete, Get Search Results to retrieve findings
Managing Alerts
- Use List Fired Alerts to see recent alert triggers
- Use Get Fired Alert Details to investigate specific alerts
- Use Acknowledge Alert to mark alerts as reviewed
Working with Saved Searches
- List Saved Searches - Browse all saved/scheduled searches
- Get Saved Search - View configuration of a specific search
- Create Saved Search - Set up new scheduled searches or alerts
- Update Saved Search - Modify existing searches
- Delete Saved Search - Remove unneeded searches
Monitoring Your Environment
- Get Server Info - Check Splunk version and configuration
- List Indexes - See available data repositories
- List Data Inputs - View configured data sources
- List Users and List Roles - Audit access control
Troubleshooting
Connection Failed
Cause: Cannot reach the Splunk management port
Solution:
- Verify the URL includes
https://and the port (:8089) - Ensure port 8089 is accessible (not blocked by firewall)
- For Splunk Cloud, verify port 8089 is enabled via Splunk Support
- Test connectivity:
curl -k https://your-instance:8089/services/server/info
Authentication Failed
Cause: Invalid or expired token
Solution:
- Verify you copied the complete token (they're typically long strings)
- Check if the token has expired in Splunk settings
- Ensure the user associated with the token has appropriate permissions
- Try generating a new token
- Verify token with:
curl -k -H "Authorization: Bearer YOUR_TOKEN" https://your-instance:8089/services/authentication/current-context
Search Job Not Found
Cause: Search job has expired or been deleted
Solution:
Splunk automatically removes old search jobs. By default, jobs are removed after their TTL (time-to-live) expires. Either:
- Retrieve results promptly after job completion
- Increase the job's TTL when creating it
- Use Export Search Results for immediate streaming results
Permission Denied
Cause: User doesn't have required capabilities
Solution:
- Check the user's role has necessary capabilities:
- For searches:
searchcapability - For saved searches:
schedule_searchcapability - For alerts:
edit_tcporadmin_all_objects - For users/roles:
edit_useroredit_roles_grantable
- For searches:
- In Splunk, go to Settings > Access controls > Roles
- Edit the user's role and add required capabilities
- Re-test the connection with the updated permissions
SSL Certificate Errors
Cause: Self-signed or invalid SSL certificate
Solution:
This connector uses HTTPS by default. If you have a self-signed certificate:
- For production, install a valid SSL certificate on your Splunk instance
- For testing/development, the connector should handle self-signed certificates
- Verify your Splunk instance is accessible via HTTPS in a browser
Rate Limiting
Cause: Too many API requests in short time
Solution:
Splunk has rate limits on API endpoints. If you encounter rate limiting:
- Reduce the frequency of requests
- Use pagination with smaller page sizes
- Cache results when possible
- For large data exports, use Export Search Results instead of multiple paginated calls
Best Practices
Search Performance
- Use specific time ranges rather than searching all data
- Limit searches to specific indexes when possible
- Use field filters early in your search queries
- Consider using Export Search Results for large result sets
Security
- Use tokens instead of username/password for API access
- Create tokens with appropriate expiration times
- Use service accounts with minimal required permissions
- Regularly audit and rotate tokens
- Never commit tokens to version control
Resource Management
- Cancel long-running searches that are no longer needed with Cancel Search Job
- Clean up old saved searches that are no longer used
- Monitor index sizes with List Indexes and Get Index Info
- Use List Search Jobs to track active searches
Alert Management
- Review fired alerts regularly with List Fired Alerts
- Acknowledge alerts after investigation with Acknowledge Alert
- Test new alerts thoroughly before enabling in production
- Document alert response procedures