Graylog icon

Graylog

Consume Graylog API (v.1.1.0)

Overview

The Graylog node for n8n enables users to interact with the Graylog API, specifically to export data based on a search type. The "Export Search Type" operation under the "Exports" resource allows you to export results from a specific search and search type, with options to filter by time range, limit results, select fields, and customize output.

Common scenarios:

  • Exporting log or event data from Graylog for reporting, analysis, or archiving.
  • Automating the extraction of search results as part of a workflow (e.g., daily exports, incident response).
  • Filtering exported data by time range, fields, or other parameters.

Practical example:
You might use this node to automatically export all error logs from the past 24 hours into a CSV file, attach it to an email, or upload it to cloud storage.


Properties

Name Type Meaning
Authentication options The authentication method to use (Token or Basic Authentication).
Search Id string The unique identifier of the search whose results you want to export.
Search Type Id string The identifier of the specific search type within the search to export.
Additional Fields collection Optional fields to further customize the export (see below for details).
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.

Additional Fields (collection):

  • Timerange From (string): Start of the time range for the export.
  • Timerange To (string): End of the time range for the export.
  • Timerange Type (string): Type of time range (e.g., absolute, relative).
  • Filename (string): Desired filename for the exported data.
  • Time Zone (string): Time zone context for the export.
  • Limit (number): Maximum number of records to export.
  • Fields In Order (fixedCollection): Specify fields and their order in the export.

Output

  • The node outputs a json field containing the exported data from Graylog.
  • If the "Simplify" option is enabled, the output may be reduced to a specific property or path as defined by "Simplify Path".
  • If binary data is involved (e.g., exporting as a file), the output will include a binary field representing the exported file.

Dependencies

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

Troubleshooting

Common issues:

  • Invalid credentials: Ensure the correct authentication method and credentials are provided.
  • Missing required fields: Both "Search Id" and "Search Type Id" are mandatory; omitting them will result in errors.
  • API connectivity: Network issues or incorrect Graylog API URL can cause connection failures.
  • Permission errors: The authenticated user must have permission to perform exports on the specified search/search type.

Error messages and resolutions:

  • "Authentication failed" – Check your credentials and authentication method.
  • "Resource not found" – Verify the Search Id and Search Type Id are correct and exist in Graylog.
  • "Insufficient permissions" – Ensure the user has the necessary rights in Graylog.

Links and References

Discussion