# Working with NTL

## Overview

The Nimbus Transformation Language (NTL) is a high level language for reshaping telemetry data.

When Nimbus makes an optimization, it generates NTL to describe when and how an optimization should be made.

You can edit generated transforms to tailor it for your specific business requirements (this is not necessary in the majority of cases).

## Nimbus Predicates

Nimbus predicates evaluate a series of expressions and return a boolean. They have the following syntax

```yml
- key: 
  op:
  val:
```

* key: the dot delimited path
* op: any NTL valid operator
* val: the expected value

Note that `key` can be omitted in which case the value is expected to be a list of Nimbus predicates.

## Comparison Operators

### EQUAL

Checks whether two elements are exactly equal in value

```yml
key: foo
op: equal
val: 42
```

### EXISTS

Checks whether a particular path exists in an object

```yml
key: foo
op: exists
val: true
```

### MATCH

Regex match

```yml
key: foo
op: match
val: "foo"
```

### MATCH\_ANY

Regex match against an array of values

```yml
key: foo
op: match_any
val: ["foo", "foobar"]
```

## Logical Operators

### AND

```yml
op: AND
val: 
  - key: foo
    op: exists
    val: true
  - key: foo
    op: equal
    val: 42
```

### NOT

```yml
op: NOT
val: 
  key: foo
  op: equal
  val: 42
```

### OR

```yml
op: OR
val: 
  - key: foo
    op: exists
    val: true
  - key: foo
    op: equal
    val: 42
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nimbus.dev/overview/ntl.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
