Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs/resources/derived_column: multiline expressions #83

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion docs/resources/derived_column.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,28 @@ resource "honeycombio_derived_column" "duration_ms_log" {

dataset = var.dataset
}

resource "honeycombio_derived_column" "example_multiline_expr" {
alias = "example_multiline_expr"
description = "Example of multiline expression"

expression = trimspace(<<EOT
IF(
REG_MATCH($request, `PATCH https://www.foo.[a-z]+:443/gw/api/[0-9]+/bar?`),
AND(
OR(
STARTS_WITH($backend_status_code, "2"),
STARTS_WITH($backend_status_code, "3"),
STARTS_WITH($backend_status_code, "4")
),
LTE($backend_processing_time, 2)
)
)
EOT
)

dataset = var.dataset
}
```

## Argument Reference
Expand All @@ -24,9 +46,11 @@ The following arguments are supported:

* `dataset` - (Required) The dataset this derived column is added to.
* `alias` - (Required) The name of the derived column. Must be unique per dataset.
* `expression` - (Required) The function of the derived column. See [Derived Column Syntax](https://docs-ismith.honeycomb.io/working-with-your-data/customizing-your-query/derived-columns/#derived-column-syntax).
* `expression` - (Required) The function of the derived column. See [Derived Column Syntax](https://docs.honeycomb.io/working-with-your-data/customizing-your-query/derived-columns/#derived-column-syntax).
* `description` - (Optional) A description that is shown in the UI.

~> **Note** Use `trimline()` for multiline values of `expression`.

## Attribute Reference

In addition to all arguments above, the following attributes are exported:
Expand Down