Synthetica is a Go-based tool for generating and bulk-inserting synthetic log data into databases and search engines.
Currently supported:
- Customizable log templates (using Go
text/template). - Multi-worker parallel execution.
- Easily extensible to support new databases.
Synthetica is configured via a config.json file.
Example:
{
"workers": 2,
"documents_amount": 5,
"iterations": 3,
"body_template_file": "body.json.tmpl",
"opensearch": {
"index": "synthetic-logs",
"nodes": ["https://localhost:9200"],
"credentials": {
"username": "admin",
"password": "admin"
}
}
}Global parameters:
- workers → Number of concurrent workers;
- documents_amount → Number of documents per request;
- iterations → Number of requests per worker;
- body_template_file → Path to the JSON log template.
Database-specific parameters:
For OpenSearch:
- index → Target index;
- nodes → List of OpenSearch nodes
- credentials → Username & password.
Synthetica uses Go text/template engine with custom helpers.
Available functions:
- uuid → Generates a random UUID.
- timestamp → Current timestamp in milliseconds.
- date → Current timestamp in RFC3339Nano.
- oneOf "a" "b" "c" → Picks a random option from the provided list.
{
"timestamp": "{{date}}",
"level": "{{oneOf "INFO" "WARN" "ERROR" "DEBUG"}}",
"service": "{{oneOf "auth-service" "payment-service" "user-service" "order-service"}}",
"message": "{{oneOf "User login successful" "User login failed" "Payment processed" "Payment declined" "Order created" "Order cancelled" "Database connection error" "Cache miss detected"}}",
"host": "{{oneOf "server-1" "server-2" "server-3" "server-4"}}",
"trace_id": "{{uuid}}"
}