Last updated: July 19, 2026
dash0_spam_filter
Terraform resource for Dash0 spam filters that drop matching telemetry before ingestion.
Manages a Dash0 Spam Filter. Spam filters allow you to drop noisy or unwanted telemetry data before it is stored, reducing costs and improving signal-to-noise ratio. Filters are scoped to a dataset and can target logs, spans, or metrics.
See Set Spam Filters for more details.
Example Usage
terraform
1234567891011121314151617181920212223242526272829303132333435resource "dash0_spam_filter" "drop_health_checks" {dataset = "default"spam_filter_yaml = <<-EOFapiVersion: v1alpha1kind: Dash0SpamFiltermetadata:name: Drop noisy health checksspec:contexts:- logfilter:- key: "k8s.namespace.name"operator: "is"value: "kube-system"EOF}# v1alpha2 uses a single `context` instead of a `contexts` list.resource "dash0_spam_filter" "drop_debug_logs" {dataset = "default"spam_filter_yaml = <<-EOFapiVersion: v1alpha2kind: Dash0SpamFiltermetadata:name: Drop debug logsspec:context: logfilter:- key: "severity_text"operator: "is"value: "DEBUG"EOF}
Schema
Required
dataset(String) The identifier of the Dash0 dataset that the spam filter belongs to. Provide the dataset's identifier, which is immutable, not the 'name'. Datasets are used to separate observability data within a Dash0 organization. Changing this value forces the resource to be recreated.spam_filter_yaml(String) The spam filter definition in YAML format. The YAML must include ametadata.namefield and aspecwith afilter(list of key-value matchers) and eithercontexts(v1alpha1, a list of signal types:log,span,datapointorweb_event) orcontext(v1alpha2, a single signal type out oflog,span,datapointorweb_event). TheapiVersionfield determines which shape is expected.
Read-Only
id(String) The server-assigned UUID of the spam filter, resolved by the provider after creation. Useful for cross-referencing the filter from other resources or external systems. Spam filters are not addressable in the Dash0 web app, so nourlis exposed.origin(String) A unique identifier for the spam filter, automatically generated on creation. Used to reference the spam filter for updates, reads, deletes, and imports.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
shell
12#!/bin/bashterraform import dash0_spam_filter.drop_health_checks default,tf_existing-spam-filter-origin