vectordotdev / vectordotdev/vector

Filters/macros/function for Vector's template syntax

Open
#2,063 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

domain: config domain: templating
Dominant language
Rust
Stars
22.6k
Forks
2.3k
Avg merge
1d 7h
Merged PRs (30d)
146

Description

This has been discussed in a variety of issues (...), but we don't have an actual issue open for this work.

Motivation

Our template syntax is very limited in its current form and we've had a number of customers request ways to extend this (#1846, #1692, #1440, https://github.com/timberio/vector/issues/1926#issuecomment-599076830)

Prior Art

  1. Liquid filters - Rust implementation
  2. Jinja 2 filters

Proposal

We should support "modifiers" or "filters" within our template syntax. For example:

[sinks.archive]
  type = "aws_s3"
  key_prefix = "{{ timestamp | date: "%Y-%m-%d" }}"
Filters

We can use the prior art as a basis, but at the very least we should have:

  • default
  • strptime
  • capitalize
  • downcase
  • truncate
  • upcase

These are most useful for dynamic partitioning.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Vector's existing template-syntax entry point and reviewing the Liquid and Jinja filter references linked in the issue. Define the supported filter behavior and integration scope; the work is done when the proposed default, strptime, capitalize, downcase, truncate, and upcase filters are supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.