{{/* This partial is for pretty much all structured data (VRL stuff, CLI, API, component configs/output/telemetry, etc.) */}} {{ $ctx := . }}
{{/* Source/transform/sink config */}} {{ with .component_config }}
{{ range $k, $v := . }} {{ if ne $k "type" }} {{ $name := $k }}
{{/* Config name */}} {{ partial "heading.html" (dict "text" $name "level" 3 "anchor" true "icon" false) }} {{/* Config labels */}} {{ if $v.common }} {{ partial "badge.html" (dict "word" "common" "color" "blue") }} {{ end }} {{ if $v.required }} {{ partial "badge.html" (dict "word" "required" "color" "red") }} {{ else }} {{ partial "badge.html" (dict "word" "optional" "color" "blue") }} {{ end }} {{ range $k, $v := $v.type }} {{ $isArray := eq $k "array" }} {{ if $isArray }} {{ range $k, $v := $v.items.type }} {{ $name := printf "[%s]" $k }} {{ partial "badge.html" (dict "word" $name "color" "gray") }} {{ end }} {{ else }} {{ partial "badge.html" (dict "word" $k "color" "gray") }} {{ end }} {{ with $v.syntax }} {{ if eq . "remap_program" }} {{ partial "badge.html" (dict "word" . "color" "gray" "href" "/docs/reference/vrl#program") }} {{ else if eq . "template" }} {{ partial "badge.html" (dict "word" . "color" "gray" "href" "/docs/reference/configuration/template-syntax/") }} {{ else }} {{ partial "badge.html" (dict "word" . "color" "gray") }} {{ end }} {{ end }} {{ if $v.enum }} {{ partial "badge.html" (dict "word" "enum" "color" "yellow") }} {{ end }} {{ end }} {{ if $v.deprecated }}
{{ partial "heading.html" (dict "text" "Deprecated" "level" 4 "toc_hide" true) }}
{{/* Heroicon: outline/exclamation-circle */}}
{{ if $v.deprecated_message }} {{ $v.deprecated_message | markdownify }} {{ else }} This field is deprecated. {{ end }}
{{ end }}
{{ $v.description | markdownify }}
{{ with $v.warnings }}
{{ partial "heading.html" (dict "text" "Warning" "level" 4 "toc_hide" true) }} {{ range . }}
{{/* Heroicon: outline/exclamation-circle */}}
{{ . | markdownify }}
{{ end }}
{{ end }} {{ range $k, $v := $v.type }} {{ if eq $k "condition" }} {{ template "config-condition" (dict "name" $name "condition" $v) }} {{ end }} {{ if eq $k "object" }} {{/* Object (with sub-configs) */}}
{{ template "config-object" (dict "name" $name "config" $v "level" 4) }}
{{ else if eq $k "array" }} {{/* Array */}} {{ with $v.items }}
{{ range $k, $v := . }} {{ range $k, $v := . }} Array {{ partial "badge.html" (dict "word" $k "color" "gray") }} {{ partial "badge.html" (dict "word" $v.syntax "color" "gray") }} {{ with $v.examples }} {{ template "config-array-examples" (dict "examples" .) }} {{ end }} {{ end }} {{ end }}
{{ end }} {{ else }} {{/* Non-arrays/objects */}} {{ if eq $v.syntax "template" }}
Note: This parameter supports Vector's template syntax, which enables you to use dynamic per-event values.
{{ end }} {{ with $v.examples }} {{ template "config-examples" (dict "examples" .) }} {{ end }} {{ end }} {{/* Enum */}} {{ with $v.enum }}
Enum options {{ partial "badge.html" (dict "word" $k "color" "gray") }} {{ partial "badge.html" (dict "word" $v.syntax "color" "gray") }}
{{ template "enum-options-table" . }}
{{ end }} {{ end }} {{/* Default value */}} {{ range $k, $v := $v.type }} {{ if or $v.default (eq $v.default false) }}
{{ template "default" . }}
{{ end }} {{ end }} {{/* "Relevant when" conditions */}} {{ with .relevant_when }}
Relevant when: {{ . }}
{{ end }}
{{ end }} {{ end }}
{{ end }} {{/* Source/transform/sink requirements */}} {{ with .component_requirements }}
{{/* Heroicon: outline/exclamation */}}
{{ range . }}
{{ . | markdownify }}
{{ end }}
{{ end }} {{/* Source/transform/sink output */}} {{ with .component_output }}
{{ with .metrics }} {{ partial "heading.html" (dict "text" "Metrics" "level" 3 "id" "output-metrics" "href" "#output-metrics") }} {{/* Heroicon: solid/question-mark-circle */}}
{{ template "telemetry" . }}
{{ end }} {{ with .logs }} {{ partial "heading.html" (dict "text" "Logs" "level" 3 "id" "output-logs" "href" "#output-logs") }} {{/* Heroicon: solid/question-mark-circle */}}

Warning

The fields shown below will be different if log namespacing is enabled. See Log Namespacing for more details
{{ template "logs_output" . }}
{{ end }}
{{ end }} {{/* Source/transform outputs */}} {{ with .component_outputs }}
{{ range . }}
{{ partial "heading.html" (dict "text" .name "level" 3 "anchor" true "icon" false) }}
{{ .description | markdownify }}
{{ end }}
{{ end }} {{/* Source/transform/sink examples */}} {{ with .component_examples }} {{ $formats := slice "yaml" "toml" "json" }} {{ $defaultFormat := index $formats 0 }}
{{ range . }} {{ $configs := .configuration }} {{ $id := printf "examples-%s" .title | urlize }}
{{ partial "heading.html" (dict "text" .title "level" 3 "id" $id) }} Given this event...
{{ template "code" .input }}
...and this configuration...
{{ range $formats }} {{ end }}
{{ range $formats }} {{ $config := index $configs . }}
{{ highlight $config . "" }}
{{ end }}
...this Vector event is produced:
{{ template "code" .output }}
{{ end}}
{{ end }} {{/* Source/transform/sink output */}} {{ with .component_telemetry }}
{{ with .metrics }} {{ partial "heading.html" (dict "text" "Metrics" "level" 3 "id" "telemetry-metrics" "href" "#telemetry-metrics") }} link
{{ template "telemetry" . }}
{{ end }} {{ with .logs }} {{ partial "heading.html" (dict "text" "Logs" "id" "telemetry-logs" "href" "#telemetry-logs") }} link
{{ template "telemetry" . }}
{{ end }}
{{ end }} {{/* Source/transform/sink warnings */}} {{ with .component_warnings }}
{{ range . }}
{{ . | markdownify }}
{{ end }}
{{ end }} {{/* Source/transform/sink environment variables */}} {{ with .component_env_vars }}
{{ range $k, $v := . }}
{{ $href := printf "#%s" $k | urlize }} {{ partial "heading.html" (dict "text" $k "level" 3 "href" $href) }} {{ if $v.common }} {{ partial "badge.html" (dict "word" "common" "color" "blue") }} {{ end }} {{ if $v.required }} {{ partial "badge.html" (dict "word" "required" "color" "red") }} {{ else }} {{ partial "badge.html" (dict "word" "optional" "color" "blue") }} {{ end }} {{ range $k, $v := $v.type }} {{ partial "badge.html" (dict "word" $k "color" "gray") }} {{ with $v.syntax }} {{ partial "badge.html" (dict "word" . "color" "gray") }} {{ end }} {{ if $v.enum }} {{ partial "badge.html" (dict "word" "enum" "color" "yellow") }} {{ end }} {{ end }}
{{ $v.description | markdownify }}
{{ range $k, $v := $v.type }} {{ with $v.default }} Default: {{ . }} {{ end }} {{ end }} {{ range $k, $v := $v.type }} {{/* Enum */}} {{ with $v.enum }}
Enum options {{ partial "badge.html" (dict "word" $k "color" "gray") }} {{ partial "badge.html" (dict "word" $v.syntax "color" "gray") }}
{{ template "enum-options-table" . }}
{{ end }} {{ with $v.examples }}
Examples {{ template "config-toggler" (dict "size" 4) }}
{{ range . }}
{{ . }}
{{ end }}
{{ end }} {{ end }}
{{ end }}
{{ end }} {{/* Data schemas (logs and metrics) */}} {{ with .data_schema }}
{{ .description | markdownify }}
{{/* Options */}}
{{ partial "heading.html" (dict "text" "Options" "level" 3) }}
{{ range $k, $v := .type.object.options }} {{ $name := $k }} {{ $id := cond (eq $name "*") "star" $name }}

{{ $name }}

{{ if $v.common }} {{ partial "badge.html" (dict "word" "common" "color" "indigo") }} {{ end }} {{ if $v.required }} {{ partial "badge.html" (dict "word" "required" "color" "red") }} {{ else }} {{ partial "badge.html" (dict "word" "optional" "color" "gray") }} {{ end }} {{ range $k, $v := $v.type }} {{ $type := cond (eq $k "object") "table" $k }} {{ partial "badge.html" (dict "word" $type "color" "green") }} {{ end }}
{{ with $v.description }}
{{ . | markdownify }}
{{ end }}
{{ range $k, $v := $v.type }} {{ if eq $k "object" }}
{{ range $k, $v := $v.options }} {{ $id := printf "%s-%s" $name $k }}

{{ $k }}

{{ if $v.required }} {{ partial "badge.html" (dict "word" "required" "color" "red") }} {{ else }} {{ partial "badge.html" (dict "word" "optional" "color" "gray") }} {{ end }} {{ range $k, $v := $v.type }} {{ partial "badge.html" (dict "word" $k "color" "green") }} {{ with $v.syntax }} {{ partial "badge.html" (dict "word" . "color" "gray") }} {{ end }} {{ if $v.enum }} {{ partial "badge.html" (dict "word" "enum" "color" "yellow") }} {{ end }} {{ end }}
{{ $v.description | markdownify }}
{{ range $k, $v := $v.type }} {{ with $v.examples }}
Examples {{ range . }} {{ . }} {{ end }}
{{ end }} {{ end }}
{{ end }}
{{ end }} {{ end }}
{{ end }}
{{/* Examples */}} {{ with .type.object.examples }}
{{ partial "heading.html" (dict "text" "Examples" "level" 3) }}
{{ range . }} {{ template "code" . }} {{ end }}
{{ end }}
{{ end }} {{/* VRL function info (/vrl/functions) */}} {{ with .vrl_functions }}
{{ range . }} {{ $name := .name }} {{ $func := index site.Data.docs.remap.functions .name }} {{ $infallible := not $func.internal_failure_reasons }} {{ $args := $func.arguments }} {{ $requiredArgs := where $args "required" true }} {{ $optionalArgs := where $args "required" false }} {{ $lastArg := sub (len $args) 1 }} {{ $return := $func.return }}
{{/* Function title */}} {{ $href := printf "#%s" $name }} {{ partial "heading.html" (dict "text" $name "level" 3 "href" $href "icon" false) }} {{/* Badges */}} {{ $href := "/docs/reference/vrl/expressions/#function-call-characteristics" | relURL }} {{ if $infallible }} {{ partial "badge.html" (dict "word" "infallible" "color" "blue" "inline" true "href" $href) }} {{ else }} {{ partial "badge.html" (dict "word" "fallible" "color" "yellow" "inline" true "href" $href) }} {{ end }} {{/* Deprecation Badge */}} {{ if $func.deprecated }} {{ partial "badge.html" (dict "word" "deprecated" "color" "red" "inline" true "href" $href) }} {{ end }} {{/* Function description */}}
{{ $func.description | markdownify }}
{{/* Function spec, etc. */}} {{ $id := printf "%s-function-spec" $name }}
{{ partial "heading.html" (dict "text" "Function spec" "level" 4 "id" $id "toc_hide" true) }}
{{ $name }}( {{- $lastArg := sub (len $requiredArgs) 1 -}} {{- range $idx, $arg := $requiredArgs -}} {{ $isLast := eq $idx $lastArg -}} {{- .name -}} : <{{ delimit .type ` | ` }}>{{ if not $isLast }}, {{ end -}} {{ end -}} {{- if gt (len $optionalArgs) 0 -}}, [{{- $lastArg := sub (len $optionalArgs) 1 -}} {{- range $idx, $arg := $optionalArgs -}} {{ $isLast := eq $idx $lastArg -}} {{- .name -}} : <{{ delimit .type ` | ` }}>{{ if not $isLast }}, {{ end -}} {{ end -}}]{{ end }}) {{- with $return -}}
:: <{{ delimit .types " | " }}> {{ if not $infallible }}, <error>{{ end }}
{{- end -}}
{{ template "vrl-function-legend" }}
{{/* Function arguments */}} {{ with $args }}
{{ template "vrl-function-args" . }}
{{ end }} {{/* Function notices */}} {{ with $func.notices }} {{ $id := printf "%s-notices" $name }}
{{ partial "heading.html" (dict "text" "Notices" "level" 4 "id" $id "toc_hide" true) }} This function has special behavior that you should be aware of.
{{ range . }}
{{/* Heroicon: outline/exclamation-circle */}}
{{ . | markdownify }}
{{ end }}
{{ end }} {{/* Function errors */}} {{ with $func.internal_failure_reasons }} {{ $id := printf "%s-errors" $name }}
{{ partial "heading.html" (dict "text" "Errors" "level" 4 "id" $id "toc_hide" true) }} The {{ $name }} function is fallible, which means that error handling is required for these errors:
{{ range . }}
{{/* Heroicon: outline/exclamation */}}
{{ . | markdownify }}
{{ end }}
{{ end }} {{/* Function examples */}} {{ with $func.examples }} {{ $id := printf "%s-examples" $name }}
{{ partial "heading.html" (dict "text" "Examples" "level" 4 "id" $id "toc_hide" true) }}
{{ range . }} {{ template "vrl-function-example" (dict "name" $name "ctx" .) }} {{ end }}
{{ end }}
{{ end }}
{{ end }} {{/* Real-world examples */}} {{ with .vrl_real_world_examples }}
{{ range . }} {{ $input := dict "message" .input.log.message | jsonify (dict "indent" " ") }} {{ $vrlSourceCode := highlight .source "toml" "" }} {{ $output := .output | jsonify (dict "indent" " ") }} {{ $outputCode := highlight $output "json" "" }}
{{ $href := printf "#%s" (.title | urlize) }} {{ partial "heading.html" (dict "text" .title "level" 3 "href" $href "icon" false) }}
{{ with .input.log }} {{ $json := . | jsonify (dict "indent" " ") }} {{ $code := highlight $json "json" "" }} Given this Vector log event... {{ $code }} {{ end }} {{ with .input.metric }} {{ $json := . | jsonify (dict "indent" " ") }} {{ $code := highlight $json "json" "" }} Given this Vector metric event... {{ $code }} {{ end }} ...and this VRL program... {{ $vrlSourceCode }} {{ if .raises }} {{ $errorCode := highlight .raises.compiletime "rust" "" }} ...you should see this error: {{ $errorCode }} {{ else }} {{ with .input.log }} ...the following log event is output: {{ end }} {{ with .input.metric }} ...the following metric event is output: {{ end }} {{ $outputCode }} {{ end }}
{{ end }}
{{ end }} {{/* Compile-time errors */}} {{ with .vrl_compile_time_errors }}
{{ range $code, $error := . }} {{ $id := printf "%s %s" $code $error.title | urlize }}

{{ $code }} {{ $error.title }}

{{ with $error.description }}
{{ . | markdownify }}
{{ end }} {{ with $error.rationale }} {{ $id := printf "error-%s-rationale" $code }}
{{/* Heroicon: outline/zoom-in */}} {{ partial "heading.html" (dict "text" "Rationale" "level" 4 "id" $id "toc_hide" true) }}
{{ . | markdownify }}
{{ end }} {{ with $error.resolution }} {{ $id := printf "error-%s-resolution" $code }}
{{/* Heroicon: outline/trending-up */}} {{ partial "heading.html" (dict "text" "Resolution" "level" 4 "id" $id "toc_hide" true) }}
{{ . | markdownify }}
{{ end }} {{ with $error.examples }} {{ $id := printf "error-%s-examples" $code }}
{{/* Heroicon: outline/code */}} {{ partial "heading.html" (dict "text" "Examples" "level" 4 "toc_hide" true "id" $id) }} {{ template "vrl-toggler" }}
{{ range . }} {{ $id := printf "error-%s-example-%s" $code (.title | urlize) }}
{{ partial "heading.html" (dict "text" .title "level" 5 "id" $id "toc_hide" true) }} {{/* Example event (log or metric) */}} {{ with .input }} {{ with .log }} {{/* Log event */}} {{ $json := . | jsonify (dict "indent" " ") }}
Log event {{ highlight $json "json" "" }}
{{ end }} {{ with .metric }} {{/* Metric event */}} {{ $json := . | jsonify (dict "indent" " ") }}
Metric event {{ highlight $json "json" "" }}
{{ end }} {{ end }} {{ with .source }}
VRL program {{ highlight . "coffee" "" }}
{{ end }} {{/* Example diff */}} {{ with .diff }}
How to fix it {{ highlight . "diff" "" }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }} {{/* VRL expressions */}} {{ with .vrl_expressions }}
{{ range $k, $v := . }}
{{ partial "heading.html" (dict "text" $v.title "level" 3) }}
{{ $v.description | markdownify }}
{{ with $v.grammar }} {{ $id := printf "%s-grammar" $k }}
{{ partial "heading.html" (dict "text" "Grammar" "level" 4 "id" $id) }}
{{ highlight .source "coffee" "" }}
{{ with .definitions }}
{{ range $k, $v := . }} {{ end }}
Argument Meaning
{{ $k }} {{ $v.description | markdownify }}
{{ end }}
{{ end }} {{ with $v.examples }} {{ $id := printf "%s-examples" $k }}
{{ partial "heading.html" (dict "text" "Examples" "level" 4 "id" $id) }}
{{ range . }} {{ template "vrl-data-example" (dict "name" $k "ctx" .) }} {{ end }}
{{ end }} {{ with $v.characteristics }} {{ $id := printf "%s-characteristics" ($v.title | urlize) }}
{{ partial "heading.html" (dict "text" "Characteristics" "level" 4 "id" $id) }}
{{ range . }}
{{ partial "heading.html" (dict "text" .title "level" 5 "icon" false) }} {{ with .description }}
{{ . | markdownify }}
{{ end }} {{ with .enum }}
Enum options
{{ template "enum-options-table" . }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }} {{/* VRL examples */}} {{ with .vrl_examples }}
{{ range . }} {{ $name := .name }} {{ $link := printf "docs/reference/vrl/functions/#%s" $name | relURL }}
{{ partial "heading.html" (dict "text" $name "level" 3) }}
{{ .description | markdownify }}
{{ range .examples }}
{{ partial "heading.html" (dict "text" .title "level" 4) }}
Source
{{ highlight .source "coffee" "" }}
{{ with .return }}
Return
{{ template "code" . }}
{{ end }}
{{/* Heroicon: outline/light-bulb */}} Learn more about the {{ $name }} function
{{ end }}
{{ end }}
{{ end }} {{/* VRL syntax */}} {{ with .vrl_syntax }}
{{ range . }} {{ $title := .title }}
{{ partial "heading.html" (dict "text" .title "level" 3) }} {{ with .description }}
{{ . | markdownify }}
{{ end }} {{ with .examples }} {{ $id := printf "%s-examples" (urlize $title) }}
{{ partial "heading.html" (dict "text" "Examples" "level" 4 "id" $id) }}
{{ range . }} {{ highlight . "text" "" }} {{ end }}
{{ end }}
{{ end }}
{{ end }} {{/* VRL literals */}} {{ with .vrl_literals }}
{{ range $k, $v := . }}
{{ partial "heading.html" (dict "text" $v.title "level" 3 "icon" false) }} {{ with $v.description }}
{{ . | markdownify }}
{{ end }} {{ with $v.examples }} {{ $id := printf "%s-examples" ($v.title | urlize) }}
{{ partial "heading.html" (dict "text" "Examples" "level" 4 "id" $id) }}
{{ range . }} {{ highlight . "coffee" "" }} {{ end }}
{{ end }} {{ with $v.characteristics }} {{ $id := printf "%s-characteristics" ($v.title | urlize) }}
{{ partial "heading.html" (dict "text" "Characteristics" "level" 4 "id" $id) }}
{{ range . }}
{{ partial "heading.html" (dict "text" .title "level" 5 "icon" false) }} {{ with .description }}
{{ . | markdownify }}
{{ end }} {{ with .enum }}
Enum options
{{ template "enum-options-table" . }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }} {{/* VRL concepts */}} {{ with .vrl_concepts }}
{{ range $k, $v := . }} {{ $id := .anchor }}
{{ partial "heading.html" (dict "text" $v.title "level" 3) }}
{{ $v.description | markdownify }}
{{ with $v.characteristics }} {{ $id := printf "%s-characteristics" $id }}
{{ partial "heading.html" (dict "text" "Characteristics" "level" 4 "id" $id) }}
{{ range . }}
{{ partial "heading.html" (dict "text" .title "level" 5) }}
{{ .description | markdownify }}
{{ end }}
{{ end }}
{{ end }}
{{ end }} {{/* VRL features */}} {{ with .vrl_features }}
{{ range . }} {{ $id := .anchor }}
{{ partial "heading.html" (dict "text" .title "level" 3) }}
{{ .description | markdownify }}
{{ with .characteristics }} {{ $id := printf "%s-characteristics" $id }}
{{ partial "heading.html" (dict "text" "Characteristics" "level" 4) }}
{{ range . }}
{{ partial "heading.html" (dict "text" .title "level" 5) }}
{{ .description | markdownify }}
{{ end }}
{{ end }}
{{ end }}
{{ end }} {{/* VRL principles */}} {{ with .vrl_principles }}
{{ range . }}
{{ partial "heading.html" (dict "text" .title "level" 3) }}
{{ .description | markdownify }}
{{ end }}
{{ end }} {{/* Vector process */}} {{ with .process }}
{{/* Signals */}}
{{ partial "heading.html" (dict "text" "Signals" "level" 3 "anchor" true) }}
{{ .process_signals.description | markdownify }}
{{ range .process_signals.signals }} {{ end }}
Signal Description
{{ .name }} {{ .description | markdownify }}
{{/* Exit codes */}}
{{ partial "heading.html" (dict "text" "Exit codes" "level" 3 "anchor" true) }}
{{ .exit_codes.description | markdownify }}
{{ range .exit_codes.codes }} {{ end }}
Code Description
{{ .code }} {{ .description | markdownify }}
{{ end }} {{ with .component_permissions }}
{{ range . }} {{/* TODO: remove the need for this double loop in the CUE sources */}} {{ range . }}
Platform: {{ .platform_title }}
Relevant policies
{{ range .policies }} {{ end }}
Policy Required for Required when
{{ .action }}
    {{ range .required_for }}
  • {{ . }}
  • {{ end }}
{{ .required_when | markdownify }}
{{ end }} {{ end }}
{{ end }}
{{ define "enum-options-table" }} {{ range $k, $v := . }} {{ end }}
Option Description
{{ $k }} {{ $v | markdownify }}
{{ end }} {{ define "config-examples" }}
Examples {{ template "config-toggler" (dict "size" 4) }}
{{ range .examples }} {{ $json := . | jsonify (dict "indent" " ") }} {{ highlight $json "json" "" }} {{ end }}
{{ end }} {{ define "config-array-examples" }} {{ $json := .examples | jsonify (dict "indent" " ") }}
Examples {{ template "config-toggler" (dict "size" 4) }}
{{ highlight $json "json" "" }}
{{ end }} {{ define "config-toggler" }} {{ $size := .size | default 4 }} {{/* Heroicon: outline/chevron-down */}} {{/* Heroicon: outline/chevron-up */}} {{ end }} {{ define "default" }}
default: {{ .default }}{{ with .unit }} ({{ . }}){{ end }}
{{ end }} {{ define "vrl-function-example" }} {{ $id := printf "%s-examples-%s" .name (.ctx.title | urlize) }}
{{ partial "heading.html" (dict "text" .ctx.title "level" 5 "id" $id "toc_hide" true) }}
Source
{{ template "code" .ctx.source }}
{{ with .ctx.return }}
Return
{{ template "code" . }}
{{ end }}
{{ end }} {{ define "logs_output" }} {{ range $k, $v := . }} {{ $title := $k | title }} {{ $id := printf "%s-log-output" $k }}
{{ partial "heading.html" (dict "text" $title "level" 4 "id" $id) }} {{ with $v.description }}
{{ . | markdownify }}
{{ end }} {{ with $v.fields }} {{ $id := printf "%s-fields" $k }}
{{ partial "heading.html" (dict "text" "Fields" "level" 5 "id" $id) }}
{{ range $k, $v := . }}
{{ $k }} {{ if $v.required }} {{ partial "badge.html" (dict "word" "required" "color" "red") }} {{ else }} {{ partial "badge.html" (dict "word" "optional" "color" "blue") }} {{ end }} {{ range $k, $v := $v.type }} {{ $isArray := eq $k "array" }} {{ if $isArray }} {{ range $k, $v := $v.items.type }} {{ $name := printf "[%s]" $k }} {{ partial "badge.html" (dict "word" $name "color" "gray") }} {{ end }} {{ else }} {{ partial "badge.html" (dict "word" $k "color" "gray") }} {{ with $v.syntax }} {{ partial "badge.html" (dict "word" . "color" "gray") }} {{ end }} {{ end }} {{ end }} {{ with $v.description }}
{{ . | markdownify }}
{{ end }} {{ range $k, $v := $v.type }} {{ with $v.examples }}
Examples
{{ range . }} {{ template "code" . }} {{ end }}
{{ end }} {{ end }}
{{ end }}
{{ end }}
{{ end }} {{ end }} {{ define "telemetry" }} {{ range $k, $v := . }}
{{ partial "heading.html" (dict "text" $k "level" 4) }} {{ partial "badge.html" (dict "word" $v.type "color" "gray") }} {{ with $v.description }}
{{ . | markdownify }}
{{ end }} {{ with $v.tags }}
{{ range $k, $v := . }}
{{ $k }} {{ if not $v.required }} {{ partial "badge.html" (dict "word" "optional" "color" "blue") }} {{ end }} {{ with $v.description }}
{{ . | markdownify }}
{{ end }}
{{ end }}
{{ end }}
{{ end }} {{ end }} {{ define "vrl-function-legend" }} {{/* Heroicon: outline/map */}}
required optional <types | ...>
{{ end }} {{ define "vrl-function-arg-row" }} {{ $color := cond .required "text-secondary dark:text-primary" "text-indigo-500 dark:text-indigo-300" }} {{ .name }} {{ range .type }} {{ . }}
{{ end }}
{{ .description | markdownify }} {{ with .default }} {{ . }} {{ end }} {{ if .required }} yes {{ else }} no {{ end }} {{ end }} {{ define "vrl-function-args" }} {{ $required := where . "required" true }} {{ $optional := where . "required" false }} {{ range $required }} {{ template "vrl-function-arg-row" . }} {{ end }} {{ range $optional }} {{ template "vrl-function-arg-row" . }} {{ end }}
Argument Type Description Default Required?
{{ end }} {{ define "vrl-toggler" }} {{ end }} {{ define "vrl-data-example" }} {{ $id := printf "%s-example-%s" .name (urlize .ctx.title) }}
{{ with .ctx.title }} {{ partial "heading.html" (dict "text" . "level" 5 "id" $id "bold" true) }} {{ end }}
{{ with .ctx.input }}
Vector event
{{ template "code" . }}
{{ end }} {{ with .ctx.source }}
VRL program
{{ template "code" . }}
{{ end }} {{ with .ctx.return }}
Resulting event
{{ template "code" . }}
{{ end }}
{{ end }} {{ define "config-object" }} {{ $prefix := .name }} {{ $level := .level }} {{ $innerLevel := add $level 1 }}
{{ range $k, $v := .config.options }} {{ $name := printf "%s.%s" $prefix $k }}
{{ partial "heading.html" (dict "text" $name "level" $level "anchor" true "icon" false "mono" true) }} {{ if $v.common }} {{ partial "badge.html" (dict "word" "common" "color" "blue") }} {{ end }} {{ if $v.required }} {{ partial "badge.html" (dict "word" "required" "color" "red") }} {{ else }} {{ partial "badge.html" (dict "word" "optional" "color" "blue") }} {{ end }} {{ range $k, $v := $v.type }} {{ $isArray := eq $k "array" }} {{ if $isArray }} {{ range $k, $v := $v.items.type }} {{ $name := printf "[%s]" $k }} {{ partial "badge.html" (dict "word" $name "color" "gray") }} {{ end }} {{ else }} {{ partial "badge.html" (dict "word" $k "color" "gray") }} {{ end }} {{ with $v.syntax }} {{ if eq . "remap_program" }} {{ partial "badge.html" (dict "word" . "color" "gray" "href" "/docs/reference/vrl#program") }} {{ else if eq . "template" }} {{ partial "badge.html" (dict "word" . "color" "gray" "href" "/docs/reference/configuration/template-syntax/") }} {{ else }} {{ partial "badge.html" (dict "word" . "color" "gray") }} {{ end }} {{ end }} {{ if $v.enum }} {{ partial "badge.html" (dict "word" "enum" "color" "yellow") }} {{ end }} {{ end }}
{{ $v.description | markdownify }}
{{ if eq $v.type.string.syntax "template" }}
Note: This parameter supports Vector's template syntax, which enables you to use dynamic per-event values.
{{ end }} {{ with $v.relevant_when }}
Relevant when: {{ . }}
{{ end }} {{ range $k, $v := $v.type }} {{ if eq $k "object" }}
{{ template "config-object" (dict "name" $name "config" $v "level" $innerLevel) }}
{{ end }} {{ if eq $k "condition" }} {{ template "config-condition" (dict "name" "*" "condition" $v) }} {{ end }} {{ with $v.enum }}
Enum options
{{ template "enum-options-table" . }}
{{ end }} {{ with $v.examples }} {{ template "config-examples" (dict "examples" .) }} {{ end }} {{ if or $v.default (eq $v.default false) }}
{{ template "default" . }}
{{ end }} {{ end }}
{{ end }}
{{ end }} {{ define "code" }} {{ if reflect.IsMap . }} {{/* If a map or array, highlight as JSON */}} {{ $json := . | jsonify (dict "indent" " ") }} {{ highlight $json "json" "" }} {{ else if reflect.IsSlice . }} {{ $json := . | jsonify }} {{ highlight $json "json" "" }} {{ else if hasPrefix . "```" }} {{/* If a code sample, translate into Markdown */}} {{ . | markdownify }} {{ else }} {{/* If just a plain old string, use Ruby syntax highlighting as a best guess */}} {{ highlight . "ruby" "" }} {{ end }} {{ end }} {{ define "config-condition" }} {{ $configName := .name }}
{{ range $k, $v := .condition.options }} {{ $id := printf "%s.%s" $configName $k }}
{{ partial "heading.html" (dict "text" $id "level" 4 "mono" true) }}
{{ $v.description | markdownify }}
{{ end }}
{{ partial "heading.html" (dict "text" "Available syntaxes" "level" 3 "icon" false "toc_hide" true) }} {{ range .condition.syntaxes }} {{ end }}
Syntax Description Example
{{ .name }} {{ .description | markdownify }} {{ .example }}
{{ partial "heading.html" (dict "text" .condition.shorthand_explainer.title "level" 3 "icon" false "toc_hide" true) }}
{{ .condition.shorthand_explainer.description | markdownify }}
{{ partial "heading.html" (dict "text" "Condition config examples" "level" 3) }}
{{ range .condition.condition_examples }} {{ $name := .name }} {{ $example := .example }} {{ $vrlOnly := .vrl_only }}
{{ partial "heading.html" (dict "text" .title "level" 4) }} {{ $formats := slice "yaml" "toml" "json" }}
{{ range $formats }} {{ end }}
{{ range $formats }} {{ $code := "" }} {{ $shorthand := "" }} {{ if eq . "toml" }} {{ $code = printf "%s = { type = \"%s\", source = \"%s\" }" $configName $name $example }} {{ $shorthand = printf "%s = \"%s\"" $configName $example }} {{ else if eq . "yaml" }} {{ $code = printf "%s:\n type: \"%s\"\n source: \"%s\"" $configName $name $example }} {{ $shorthand = printf "%s: \"%s\"" $configName $example }} {{ else if eq . "json" }} {{ $code = printf "\"%s\": {\n \"type\": \"%s\",\n \"source\": \"%s\"\n}" $configName $name $example }} {{ $shorthand = printf "\"%s\": \"%s\"" $configName $example }} {{ end }}
{{ if $vrlOnly }} {{ highlight $shorthand . "" }} {{ else }} {{ highlight $code . "" }} {{ end }}
{{ end }}
{{ end }}
{{ end }}