Ana içeriğe atla

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

HeaderValue
AuthorizationBearer

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject 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

HeaderValue
AuthorizationBearer

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
connectionNamestringYesConnection name

Response

Success Response (200 OK)

{
  "success": true,
  "resultList": [
    {
      "type": "graylog",
      "name": "my-graylog-connection",
      "description": "Graylog connection for logging",
      "deployToWorker": true,
      "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

HeaderValue
AuthorizationBearer
Content-Typeapplication/json

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
connectionNamestringYesConnection name

Request Body

Full JSON Body Example - Basic TCP Connection
{
  "type": "graylog",
  "name": "my-graylog-connection",
  "description": "Graylog connection for logging",
  "deployToWorker": true,
  "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",
  "deployToWorker": true,
  "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",
  "deployToWorker": true,
  "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
FieldTypeRequiredDefaultDescription
typestringYes-Connection type discriminator field. Identifies the connection type in API requests/responses.
namestringYes-Connection name (must match path parameter)
descriptionstringNo-Connection description
deployToWorkerbooleanNotrueWhether to deploy to worker
enabledbooleanNotrueWhether connection is enabled
Graylog-Specific Fields
FieldTypeRequiredDefaultDescription
hostnamestringYes-Graylog server hostname or IP address
portintegerNo12201Graylog server port (default: 12201)
transportTypestringNoTCPTransport protocol. See GelfTransports
tlsEnabledbooleanNofalseEnable TLS encryption
tlsCertVerificationEnabledbooleanNofalseEnable TLS certificate verification (requires tlsTrustCertChainFile if true)
compressionTypestringNoNONECompression type. See Compression
gelfMessageLevelstringNoINFODefault GELF message level. See GelfMessageLevel
queueSizeintegerNo512Message queue size
reconnectDelayintegerNo2500Reconnection delay in milliseconds
connectTimeoutintegerNo10000Connection timeout in milliseconds
tcpNoDelaybooleanNotrueEnable TCP_NODELAY option (for TCP transport)
tcpKeepAlivebooleanNofalseEnable TCP keep-alive (for TCP transport)
sendBufferSizeintegerNo-1Send buffer size in bytes (-1 for system default)
maxInflightSendsintegerNo512Maximum number of in-flight send operations
threadsintegerNo0Number of worker threads (0 for default)
tlsTrustCertChainFilestring (base64)NonullTLS trust certificate chain file content (base64 encoded)
tlsTrustCertChainFileNamestringNonullTLS trust certificate chain file name
appendToAttributesbooleanNotrueAppend additional data to GELF attributes
appendToMessagebooleanNotrueAppend additional data to GELF message

Gelf Transports (transportType)

  • TCP - TCP transport (reliable, ordered delivery)
  • UDP - UDP transport (faster, but unreliable)

Compression (compressionType)

  • NONE - No compression
  • GZIP - GZIP compression
  • ZLIB - 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

  • hostname is required.
  • port defaults to 12201 (standard Graylog GELF port).
  • transportType defaults to TCP.
  • For TLS: Set tlsEnabled: true. If tlsCertVerificationEnabled: true, provide tlsTrustCertChainFile (base64-encoded certificate content).
  • tlsTrustCertChainFile should be base64-encoded certificate content.
  • sendBufferSize: -1 uses system default.
  • threads: 0 uses 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",
    "deployToWorker": true,
    "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

HeaderValue
AuthorizationBearer
Content-Typeapplication/json

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
connectionNamestringYesConnection name (must match name in body)

Request Body

Full JSON Body Example
{
  "type": "graylog",
  "name": "my-graylog-connection",
  "description": "Updated Graylog connection for logging",
  "deployToWorker": true,
  "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

HeaderValue
AuthorizationBearer

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
connectionNamestringYesConnection 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: true for encrypted connections.
    • Set tlsCertVerificationEnabled: true to verify server certificates.
    • When certificate verification is enabled, provide tlsTrustCertChainFile (base64-encoded CA certificate).
  • Compression:
    • NONE - No compression (fastest, largest messages)
    • GZIP - Good balance of compression and speed
    • ZLIB - 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: Connection changes require deployment to take effect. Set deployToWorker: true or deploy manually.