Graylog Connection
General Information
Connection Type
graylog
UI Documentation
Endpoints
List Connections
GET /apiops/projects/{projectName}/connections/?type=graylog
Get Connection
GET /apiops/projects/{projectName}/connections/{connectionName}/
Create Connection
POST /apiops/projects/{projectName}/connections/{connectionName}/
Update Connection
PUT /apiops/projects/{projectName}/connections/{connectionName}/
Delete Connection
DELETE /apiops/projects/{projectName}/connections/{connectionName}/
List Connections
Endpoint
GET /apiops/projects/{projectName}/connections/?type=graylog
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
Note: The type query parameter is required to filter connections by type.
cURL Example
curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/connections/" \
-H "Authorization: Bearer YOUR_TOKEN"
Get Connection
Endpoint
GET /apiops/projects/{projectName}/connections/{connectionName}/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| connectionName | string | Yes | Connection name |
Response
Success Response (200 OK)
{
"success": true,
"resultList": [
{
"type": "graylog",
"name": "my-graylog-connection",
"description": "Graylog connection for logging",
"enabled": true,
"hostname": "graylog.example.com",
"port": 12201,
"transportType": "TCP",
"tlsEnabled": false,
"tlsCertVerificationEnabled": false,
"compressionType": "NONE",
"gelfMessageLevel": "INFO",
"queueSize": 512,
"reconnectDelay": 2500,
"connectTimeout": 10000,
"tcpNoDelay": true,
"tcpKeepAlive": false,
"sendBufferSize": -1,
"maxInflightSends": 512,
"threads": 0,
"tlsTrustCertChainFile": null,
"tlsTrustCertChainFileName": null,
"appendToAttributes": true,
"appendToMessage": true
}
],
"resultCount": 1
}
Note: tlsTrustCertChainFile is masked in get operations.
cURL Example
curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/connections/my-graylog-connection/" \
-H "Authorization: Bearer YOUR_TOKEN"
Create Connection
Endpoint
POST /apiops/projects/{projectName}/connections/{connectionName}/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| connectionName | string | Yes | Connection name |
Request Body
Full JSON Body Example - Basic TCP Connection
{
"type": "graylog",
"name": "my-graylog-connection",
"description": "Graylog connection for logging",
"enabled": true,
"hostname": "graylog.example.com",
"port": 12201,
"transportType": "TCP",
"tlsEnabled": false,
"tlsCertVerificationEnabled": false,
"compressionType": "NONE",
"gelfMessageLevel": "INFO",
"queueSize": 512,
"reconnectDelay": 2500,
"connectTimeout": 10000,
"tcpNoDelay": true,
"tcpKeepAlive": false,
"sendBufferSize": -1,
"maxInflightSends": 512,
"threads": 0,
"tlsTrustCertChainFile": null,
"tlsTrustCertChainFileName": null,
"appendToAttributes": true,
"appendToMessage": true
}
Full JSON Body Example - UDP Connection with Compression
{
"type": "graylog",
"name": "my-graylog-udp-connection",
"description": "Graylog UDP connection with GZIP compression",
"enabled": true,
"hostname": "graylog.example.com",
"port": 12201,
"transportType": "UDP",
"tlsEnabled": false,
"tlsCertVerificationEnabled": false,
"compressionType": "GZIP",
"gelfMessageLevel": "INFO",
"queueSize": 512,
"reconnectDelay": 2500,
"connectTimeout": 10000,
"tcpNoDelay": true,
"tcpKeepAlive": false,
"sendBufferSize": -1,
"maxInflightSends": 512,
"threads": 0,
"tlsTrustCertChainFile": null,
"tlsTrustCertChainFileName": null,
"appendToAttributes": true,
"appendToMessage": true
}
Full JSON Body Example - TCP with TLS
{
"type": "graylog",
"name": "my-graylog-tls-connection",
"description": "Graylog TCP connection with TLS encryption",
"enabled": true,
"hostname": "graylog.example.com",
"port": 12201,
"transportType": "TCP",
"tlsEnabled": true,
"tlsCertVerificationEnabled": true,
"compressionType": "ZLIB",
"gelfMessageLevel": "WARNING",
"queueSize": 1024,
"reconnectDelay": 5000,
"connectTimeout": 15000,
"tcpNoDelay": true,
"tcpKeepAlive": true,
"sendBufferSize": 65536,
"maxInflightSends": 1024,
"threads": 2,
"tlsTrustCertChainFile": "base64-encoded-certificate-content",
"tlsTrustCertChainFileName": "graylog-ca.crt",
"appendToAttributes": true,
"appendToMessage": true
}
Request Body Fields
Common Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| type | string | Yes | - | Connection type discriminator field. Identifies the connection type in API requests/responses. |
| name | string | Yes | - | Connection name (must match path parameter) |
| description | string | No | - | Connection description |
| enabled | boolean | No | true | Whether connection is enabled |
Graylog-Specific Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| hostname | string | Yes | - | Graylog server hostname or IP address |
| port | integer | No | 12201 | Graylog server port (default: 12201) |
| transportType | string | No | TCP | Transport protocol. See GelfTransports |
| tlsEnabled | boolean | No | false | Enable TLS encryption |
| tlsCertVerificationEnabled | boolean | No | false | Enable TLS certificate verification (requires tlsTrustCertChainFile if true) |
| compressionType | string | No | NONE | Compression type. See Compression |
| gelfMessageLevel | string | No | INFO | Default GELF message level. See GelfMessageLevel |
| queueSize | integer | No | 512 | Message queue size |
| reconnectDelay | integer | No | 2500 | Reconnection delay in milliseconds |
| connectTimeout | integer | No | 10000 | Connection timeout in milliseconds |
| tcpNoDelay | boolean | No | true | Enable TCP_NODELAY option (for TCP transport) |
| tcpKeepAlive | boolean | No | false | Enable TCP keep-alive (for TCP transport) |
| sendBufferSize | integer | No | -1 | Send buffer size in bytes (-1 for system default) |
| maxInflightSends | integer | No | 512 | Maximum number of in-flight send operations |
| threads | integer | No | 0 | Number of worker threads (0 for default) |
| tlsTrustCertChainFile | string (base64) | No | null | TLS trust certificate chain file content (base64 encoded) |
| tlsTrustCertChainFileName | string | No | null | TLS trust certificate chain file name |
| appendToAttributes | boolean | No | true | Append additional data to GELF attributes |
| appendToMessage | boolean | No | true | Append additional data to GELF message |
Gelf Transports (transportType)
TCP- TCP transport (reliable, ordered delivery)UDP- UDP transport (faster, but unreliable)
Compression (compressionType)
NONE- No compressionGZIP- GZIP compressionZLIB- ZLIB compression
Gelf Message Level (gelfMessageLevel)
EMERGENCY- Emergency level (0)ALERT- Alert level (1)CRITICAL- Critical level (2)ERROR- Error level (3)WARNING- Warning level (4)NOTICE- Notice level (5)INFO- Info level (6)DEBUG- Debug level (7)
Notes
hostnameis required.portdefaults to 12201 (standard Graylog GELF port).transportTypedefaults to TCP.- For TLS: Set
tlsEnabled: true. IftlsCertVerificationEnabled: true, providetlsTrustCertChainFile(base64-encoded certificate content). tlsTrustCertChainFileshould be base64-encoded certificate content.sendBufferSize: -1uses system default.threads: 0uses default thread pool.
Response
Success Response (200 OK)
{
"success": true,
"deploymentResult": {
"success": true,
"deploymentResults": [
{
"environmentName": "production",
"success": true,
"message": "Deployment successful"
}
]
}
}
cURL Example
curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/connections/my-graylog-connection/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"type": "graylog",
"name": "my-graylog-connection",
"description": "Graylog connection for logging",
"enabled": true,
"hostname": "graylog.example.com",
"port": 12201,
"transportType": "TCP",
"tlsEnabled": false,
"compressionType": "NONE",
"gelfMessageLevel": "INFO"
}'
Update Connection
Endpoint
PUT /apiops/projects/{projectName}/connections/{connectionName}/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
| Content-Type | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| connectionName | string | Yes | Connection name (must match name in body) |
Request Body
Full JSON Body Example
{
"type": "graylog",
"name": "my-graylog-connection",
"description": "Updated Graylog connection for logging",
"enabled": true,
"hostname": "graylog-new.example.com",
"port": 12201,
"transportType": "TCP",
"tlsEnabled": false,
"tlsCertVerificationEnabled": false,
"compressionType": "NONE",
"gelfMessageLevel": "WARNING",
"queueSize": 1024,
"reconnectDelay": 5000,
"connectTimeout": 15000,
"tcpNoDelay": true,
"tcpKeepAlive": true,
"sendBufferSize": 8192,
"maxInflightSends": 1024,
"threads": 4,
"tlsTrustCertChainFile": null,
"tlsTrustCertChainFileName": null,
"appendToAttributes": true,
"appendToMessage": true
}
Note: Request body structure is the same as Create Connection. All fields should be provided for update.
Response
Success Response (200 OK)
{
"success": true,
"deploymentResult": {
"success": true,
"deploymentResults": [...]
}
}
Delete Connection
Endpoint
DELETE /apiops/projects/{projectName}/connections/{connectionName}/
Request
Headers
| Header | Value |
|---|---|
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| connectionName | string | Yes | Connection name |
Response
Success Response (200 OK)
{
"success": true,
"deploymentResult": {
"success": true,
"deploymentResults": [...]
}
}
Notes and Warnings
-
Transport Types:
TCP- Reliable, ordered delivery. Recommended for production.UDP- Faster, but unreliable. Use for high-throughput scenarios where message loss is acceptable.
-
TLS Encryption:
- Enable
tlsEnabled: truefor encrypted connections. - Set
tlsCertVerificationEnabled: trueto verify server certificates. - When certificate verification is enabled, provide
tlsTrustCertChainFile(base64-encoded CA certificate).
- Enable
-
Compression:
NONE- No compression (fastest, largest messages)GZIP- Good balance of compression and speedZLIB- Better compression, slightly slower- Compression is especially useful for UDP transport to reduce packet size.
-
Message Levels:
- GELF message levels follow syslog severity levels.
- Lower numeric values indicate higher severity.
- Default level is
INFO.
-
Performance Tuning:
queueSize- Larger queues handle bursts better but use more memory.maxInflightSends- Higher values improve throughput but use more resources.threads- More threads improve concurrency (0 uses default).sendBufferSize- Larger buffers improve throughput (-1 uses system default).
-
TCP Options:
tcpNoDelay: true- Disables Nagle's algorithm (lower latency).tcpKeepAlive: true- Keeps connections alive (useful for long-lived connections).
-
Reconnection:
reconnectDelay- Delay before reconnecting after failure (milliseconds).connectTimeout- Maximum time to wait for connection establishment (milliseconds).
-
Message Attributes:
appendToAttributes: true- Adds additional fields to GELF attributes.appendToMessage: true- Adds additional data to GELF message field.
-
Port: Default port is 12201 (standard Graylog GELF port). Ensure Graylog server is configured to accept connections on this port.
-
Deployment: Saving the connection deploys it to the workers; the response carries the deployment result.
Related Documentation
- List Connections - List all connections
- Get Connection - Get a specific connection
- Create Connection - General connection creation guide
- Update Connection - General connection update guide
- Delete Connection - General connection deletion guide