Graylog
Give an agent access to Graylog with an API token.
Required permissions
list_streams
streams:read
Get a list of all Graylog streams. Useful for finding the IDs of streams to limit the search using search_logs.
search_logs
streams:read, search:execute, message:read
Search Graylog logs/messages. Use query and one of two time range types to filter data relevant to the current alert. Specify either both absolute time ranges or the keyword alternative. Absolute time ranges take precedence.
Create API token
Using the Graylog MCP server requires an API token with appropriate permissions.
Create token via Graylog web interface
Log in to your Graylog web interface
Navigate to System → Users (or Administration → Users depending on your Graylog version)
Select the user you want to create a token for, or create a new user specifically for the MCP agent:
Click Create user (if creating a new user)
Enter username, email, and password
Assign appropriate role (see next step)
Assign permissions to the user
Go to System → Roles (or Administration → Roles)
Create a new role or edit an existing one (e.g., "ilert-readonly")
Grant the following permissions:
streams:read- Read access to streamsstreams:read:YOUR_STREAM_ID- Read access to specific streams (optional, for restricted access)search:execute- Execute search queriesmessage:read- Read log messages
Assign this role to your user
Generate an API token
Navigate to System → Users → Select your user
Go to the Tokens tab (or API Tokens section)
Click Create API token (or Generate token)
Enter a name for the token (e.g., "ilert-mcp-agent")
Set expiration (optional, recommended for security)
Click Create or Generate
Copy the API token immediately (it won't be shown again)
Store the token securely. You will need this token when setting up the Graylog MCP server in ilert.
Create API token via REST API
Alternatively, you can create an API token using the Graylog REST API.
Authenticate and get a session token
curl -X POST "https://your-graylog-instance:9000/api/system/sessions" \
-H "Content-Type: application/json" \
-d '{
"username": "admin",
"password": "your-password",
"host": "your-hostname"
}'Extract the session token from the response.
Create an API token
curl -X POST "https://your-graylog-instance:9000/api/users/YOUR_USERNAME/tokens" \
-H "Content-Type: application/json" \
-H "X-Requested-By: ilert" \
-H "Authorization: Basic YOUR_SESSION_TOKEN" \
-d '{
"name": "ilert-mcp-agent",
"expiration": "365d"
}'Replace YOUR_USERNAME with your Graylog username and YOUR_SESSION_TOKEN with the session token from the previous step.
Verify API token access
Before configuring the MCP server, verify that your API token works:
# Test API token authentication
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
https://your-graylog-instance:9000/api/system/overview
# Test search access
curl -X POST "https://your-graylog-instance:9000/api/search/universal/relative" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "*",
"range": 3600
}'Replace YOUR_API_TOKEN with your actual API token and your-graylog-instance with your Graylog server URL.
Connect Graylog with agent
To connect Graylog with your AI SRE agent:
Navigate to Agents in the ilert navigation menu
Open the agent detail view for the agent you want to configure
Go to the Tools tab
Under the ilert hosted MCP servers section, locate the Graylog card
Click Connect on the Graylog card
In the connection dialog that appears:
Select connector: Choose "Create new connector" (or select an existing connector if you have one)
Type: Select Bearer Token from the dropdown
Secret name: Enter a name for your connector (e.g., "Graylog Production" or "Graylog Main")
Secret value: Paste the API token you created earlier
Host URL: Enter your Graylog instance URL (e.g.,
https://graylog.example.com:9000)
Click Connect to complete the connection
After connecting, you can enable or disable specific tools needed for alert investigation, such as:
list_streams- Get a list of all Graylog streamssearch_logs- Search Graylog logs/messages with flexible query options
The Graylog integration is now connected and ready to use for root cause analysis.
Last updated
Was this helpful?