ezgh obs datasets transforms test <dataset> -f <rules.json> --records <otlp.json> --signal logs|traces|metrics [flags]Run a draft document’s rules for one signal on sample records, as ingest would, and show what they did; nothing is saved. -f is the document (as for set, or the output of get -o json); --records is an OTLP/JSON export request of the signal ({“resourceLogs”: …}, {“resourceSpans”: …} or {“resourceMetrics”: …}). Every resource runs the rules, whatever its environment. The rules and records go in one request of at most 1 MiB, the records at most 256 KiB.
It shows how many records the rules dropped and where they were in the input (resource, scope, record and item, numbered from 0), the rules that failed on a record (a failing statement is skipped and a failing condition is false, as at ingest) and, for metrics, input points from different series that the rules put in the same series at the same time. --output-records writes the transformed records (OTLP/JSON, the input’s order minus what was dropped) to a file; -o json prints the whole answer.
Part of ezgh obs datasets transforms.
Examples
ezgh obs datasets transforms test production -f rules.json --records sample-logs.json --signal logs
ezgh obs datasets transforms get production -o json | ezgh obs datasets transforms test production -f - --records spans.json --signal traces --output-records out.jsonFlags
| Flag | Type | Default | Description |
|---|---|---|---|
-f, --file |
string | the rules’ JSON file, or - for stdin | |
--output-records |
string | write the transformed records (OTLP/JSON) to this file | |
--records |
string | an OTLP/JSON export request of the signal, or - for stdin | |
--signal |
string | the signal whose rules run: logs, traces or metrics |
This command also takes the global flags.