Jinja
The Jinja connector enables the rendering of dynamic content using templating, allowing for the creation of customized outputs based on user-provided JSON data and templates.
Jinja is a powerful templating engine used to generate dynamic content with ease. The Jinja connector for Swimlane Turbine allows users to automate the creation of customized documents by rendering templates with JSON data. This integration streamlines the process of generating reports, alerts, and notifications, tailored to the specific needs of security operations. By leveraging Jinja's templating capabilities within Swimlane Turbine, users can enhance their security workflows with personalized, data-driven document generation, saving time and reducing manual effort.
Limitations
None to date.
Supported Versions
This Jinja connector uses the latest Version.
Additional Docs
Authentication Methods
None to date.
Capabilities
This Jinja Connector provides the following capabilities:
- Render Object
- Render Template
Render Object
- Processes a JSON file and a Jinja template file (such as HTML, TXT, or CSV), rendering the template with the provided data to produce a new file attachment.
- Accepts: * One Jinja template file (.html, .txt, or .csv). * One JSON file containing the input data.
- Produces a rendered file output in formats like .html, .txt, or .csv
Example Input
example.json
{
"user": "Alice",
"severity": "High",
"incident_id": 1234,
"department": "IT",
"timestamp": "2025-05-22T14:35:00Z",
"details": "Unauthorized access attempt detected."
}example.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Incident Report</title>
</head>
<body>
<h1>Incident Report</h1>
<p><strong>User:</strong> {{ input_json.user }}</p>
<p><strong>Department:</strong> {{ input_json.department }}</p>
<p><strong>Incident ID:</strong> {{ input_json.incident_id }}</p>
<p><strong>Severity:</strong> {{ input_json.severity }}</p>
<p><strong>Timestamp:</strong> {{ input_json.timestamp }}</p>
<p><strong>Details:</strong> {{ input_json.details }}</p>
</body>
</html>example.txt
User: {{ input_json.user }}
Department: {{ input_json.department }}
Incident ID: {{ input_json.incident_id }}
Severity: {{ input_json.severity }}
Timestamp: {{ input_json.timestamp }}
Details: {{ input_json.details }}example.csv
user,department,incident_id,severity,timestamp,details
{{ input_json.user }},{{ input_json.department }},{{ input_json.incident_id }},{{ input_json.severity }},{{ input_json.timestamp }},{{ input_json.details }}Render Template
Renders a template string using the provided JSON data.
Example Input
example.json
{
"name": "Sandrineeee",
"score": 100,
"alert-title": "T1552-Defender ATP - Potential Credential stored in a file",
"alert-state": "Success",
"alert-name": "T1552-Defender ATP - Potential Credential stored in a file",
"alert-product": "Azure Sentinel"
}example_template.txt
The json has Alert Title : {{ alert_title }} and state {{ alert_state }} .Example Output
The json has Alert Title : T1552-Defender ATP - Potential Credential stored in a file and state Success .Actions
Render Object
Processes a JSON and Jinja template to generate a file attachment using the 'attachments' input.
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
attachments | array | Required | Upload two file attachments. One Jinja template file (.html, .txt, or .csv) and one JSON file containing the input data. |
attachments.file | string | Optional | Parameter for Render Object |
attachments.file_name | string | Optional | Name of the resource |
Input Example
{"attachments":[{"file":"string","file_name":"Example Name"}]}
Output
Parameter | Type | Description |
|---|---|---|
file | object | Attachment. |
file.file | string | Output field: file.file |
file.file_name | string | Name of the resource |
Output Example
{"file":{"file":"string","file_name":"Example Name"}}
Render Template
Renders a Jinja template using the provided JSON and String, producing a processed output.
Endpoint
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
record | object | Optional | Parameter for Render Template |
record.name | string | Optional | Name of the resource |
record.score | number | Optional | Score value |
record.alert-title | string | Optional | Parameter for Render Template |
record.alert-state | string | Optional | Parameter for Render Template |
record.alert-name | string | Optional | Name of the resource |
record.alert-product | string | Optional | Parameter for Render Template |
text_data | string | Optional | Response data |
Input Example
{"record":{"name":"Sandrineeee","score":100,"alert-title":"T1552-Defender ATP - Potential Credential stored in a file","alert-state":"Success","alert-name":"T1552-Defender ATP - Potential Credential stored in a file","alert-product":"Azure Sentinel"},"text_data":"The json has Alert Title : {{ alert_title }} and state {{ alert_state }} ."}
Output
Parameter | Type | Description |
|---|---|---|
rendered_template | string | Output field: rendered_template |
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
headers | object | HTTP headers for the request |
Output Example
{"rendered_template":"The json has Alert Title : T1552-Defender ATP - Potential Credential stored in a...","status_code":200,"reason":"OK","headers":{}}
Response Headers
Header | Description | Example |
|---|---|---|
Content-Type | The media type of the resource | application/json |
Date | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT |