Graylog icon

Graylog

Consume Graylog API (v.1.1.0)

Overview

The Graylog node for n8n allows you to interact with the Graylog API, specifically to export messages using the "Export Message" operation under the "Messages" resource. This node is useful for automating the retrieval and export of log messages from a Graylog server, which can be beneficial for monitoring, auditing, or integrating log data into other workflows.

Common scenarios:

  • Exporting logs for analysis or reporting.
  • Automating log backups.
  • Integrating Graylog message exports with other systems (e.g., sending exported logs to cloud storage or alerting tools).

Practical example:
You could use this node in an n8n workflow to periodically export error logs from Graylog, filter them by time range or stream, and then send them via email or store them in a database.


Properties

Name Type Meaning
Authentication options The authentication method to use for connecting to Graylog ("Token Authentication" or "Basic Authentication").
Additional Fields collection Optional parameters to refine the export, such as chunk size, time range, streams, limit, time zone, fields order, and query string.
Simplify boolean If enabled, simplifies the output structure for easier downstream processing.
Simplify Path string Path to the property that should be returned when simplifying the output.

Details on Additional Fields:

  • Chuck Size: Number – Size of each chunk in the export.
  • Timerange Type: String – Type of time range to filter messages.
  • Streams: Collection – Specify one or more streams to filter messages.
  • Limit: Number – Maximum number of messages to export.
  • Time Zone: String – Time zone context for the export.
  • Fields In Order: Collection – Specify the order of fields in the export.
  • Query String: String – Custom query to filter messages.

Output

  • The node outputs a json field containing the exported messages from Graylog.
  • If the Simplify option is enabled, the output will be simplified according to the specified Simplify Path.
  • The structure of the output typically includes:
    • An array of message objects, each representing a log entry.
    • Metadata about the export (such as total count, time range, etc.), depending on the Graylog API response and selected options.

Note:
If binary data is involved (e.g., exporting as a file), the node may output binary data representing the exported messages.


Dependencies

  • External Services: Requires access to a running Graylog instance with API enabled.
  • API Credentials:
    • For Token Authentication: A valid Graylog API token.
    • For Basic Authentication: Valid username and password for Graylog.
  • n8n Configuration:
    • Credentials must be set up in n8n for either "graylogTokenApi" or "graylogBasicApi", depending on the chosen authentication method.

Troubleshooting

Common issues:

  • Authentication errors:

    • Error message: "Invalid credentials" or "401 Unauthorized".
      Resolution: Ensure the correct authentication method and valid credentials are provided in n8n.
  • Connection errors:

    • Error message: "Unable to connect to Graylog API".
      Resolution: Check network connectivity and ensure the Graylog API endpoint is accessible from the n8n instance.
  • Parameter errors:

    • Error message: "Missing required parameter" or "Invalid parameter value".
      Resolution: Verify all required fields are filled and values are within expected ranges/types.
  • Output parsing errors (when using Simplify/Simplify Path):

    • Error message: "Property not found at simplify path".
      Resolution: Double-check the path provided in "Simplify Path" matches the structure of the Graylog API response.

Links and References

Discussion