This step-by-step guide helps you configure Tremor connectors and events components to interact with your databases, APIs, and ingest data from these sources into Axiom.
Axiom provides a unique way of ingesting Tremor logs into Axiom. With your connector definitions, you can configure Tremor connectors and events components to interact with your external systems, such as databases, message queues, or APIs, and eventually ingest data from these sources into Axiom.
To send logs via Tremor to Axiom, you need to create a configuration file. For example, create axiom-http.troy with the following content (using a file as example data source):
text
define flow client_sink_onlyflow use std::time::nanos; use tremor::pipelines; define connector input from file args file = "in.json" # Default input file is 'in.json' in current working directory with codec = "json", # Data is JSON encoded preprocessors = ["separate"], # Data is newline separated config = { "path": args.file, "mode": "read" }, end; create connector input; define connector http_client from http_client args dataset, token with config = { "url": "https://AXIOM_DOMAIN/v1/ingest/#{args.dataset}", "tls": true, "method": "POST", "headers": { "Authorization": "Bearer #{args.token}" }, "timeout": nanos::from_seconds(10), "mime_mapping": { "*/*": {"name": "json"}, } } end; create connector http_client with dataset = "DATASET_NAME", token = "API_TOKEN" end; create pipeline passthrough from pipelines::passthrough; connect /connector/input to /pipeline/passthrough; connect /pipeline/passthrough to /connector/http_client;end;deploy flow client_sink_only;
This assumes you have set TREMOR_PATH in your environment pointing to tremor-runtime/tremor-script/lib if you are using a src clone then you can execute it as follows tremor server run axiom-http.troy