correlate
relampo correlate analyzes a YAML file, detects reusable dynamic values, and can generate a correlated YAML output.
Purpose
Use relampo correlate when you need to:
- identify dynamic values reused across requests
- review correlation candidates before changing the script
- apply correlation changes into a new YAML file
- export candidate output as JSON (
--json)
Before you start
- You need an input YAML file previously recorded with Relampo.
- Correlation is effective when the recorded script includes requests and responses.
Recommended workflow
- Analyze candidates with table output.
- Tune confidence threshold (
--min-confidence) when needed. - Apply all candidates (
--apply) or selected groups (--apply-ids). - Validate and execute the resulting YAML with
run.
Analyze candidates
Default analysis output (table):
relampo correlate test.yaml
Lower threshold to show more candidates:
relampo correlate test.yaml --min-confidence 0.0
Higher threshold to keep only stronger matches:
relampo correlate test.yaml --min-confidence 0.9
Optional: export candidates as JSON:
relampo correlate test.yaml --json
Apply correlations
Apply all detected candidates:
relampo correlate test.yaml --apply
Apply all candidates and write to a custom output:
relampo correlate test.yaml --apply -o test.correlated.yaml
Apply only selected table candidate IDs:
relampo correlate test.yaml --apply-ids "1-3,5" -o test.partial.correlated.yaml
If you do not pass -o/--output, Relampo still applies the changes and writes the result with the default name <input-without-yaml-extension>.correlated.yaml. With a YAML argument, that file is the base input. Without a YAML argument, Relampo reuses the last script used in correlation as the base input.
--apply-ids accepts individual IDs, ranges, or a mix of both:
- Individual IDs:
--apply-ids 1,2,5or--apply-ids "1,2,5" - Ranges:
--apply-ids 1-4or--apply-ids "1-4" - Mixed values:
--apply-ids 1-3,5or--apply-ids "1-3,5"
For Relampo, quoted and unquoted values mean the same thing. The quotes only make the value explicit for the terminal, so users can choose the format that is most comfortable for their shell.
Input behavior
- With a YAML argument,
correlateuses that file. - Without an argument,
correlatetries to reuse the last input saved by previous runs:
relampo correlate
If there is no saved previous input, the command returns an error.
What Relampo does during execution
When running correlate, Relampo:
- validates input availability
- parses YAML and scans request/response flow
- detects candidates
- prints table output (default) or JSON (
--json) - writes correlated YAML when apply mode is used
Output file behavior
- If
-o/--outputis provided, Relampo writes to that path. - If you apply correlations and do not pass
-o/--output, Relampo automatically generates this output name:
<input-without-yaml-extension>.correlated.yaml
Example:
- input:
test.yaml - default output:
test.correlated.yaml
Minimal examples
relampo correlate test.yaml
relampo correlate test.yaml --apply
relampo correlate test.yaml --apply-ids "1,3,7"
Common errors
- Input file not found.
- No YAML argument and no previous correlate input saved.
- Invalid
--apply-idsformat or IDs out of range. - Output path not writable.
- Script without recorded responses to correlate.
Next command
After generating the correlated file:
relampo run test.correlated.yaml