Skip to content

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerHelmuth committed Jun 8, 2023
1 parent d2153dd commit 1102d76
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions pkg/ottl/ottlfuncs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ Available Converters:
- [ConvertCase](#convertcase)
- [FNV](#fnv)
- [Int](#int)
- [IsMap](#ismap)
- [IsMatch](#ismatch)
- [IsString](#isstring)
- [Log](#log)
- [ParseJSON](#parsejson)
- [SHA1](#sha1)
Expand Down Expand Up @@ -363,6 +365,23 @@ Examples:

- `Int("2.0")`

### IsMap

`IsMap(value)`

The `IsMap` Converter returns true if the given value is a map.

The `value` is either a path expression to a telemetry field to retrieve or a literal.

If `value` is a `map[string]any` or a `pcommon.ValueTypeMap` then returns `true`, otherwise returns `false`.

Examples:

- `IsMap(body)`


- `IsMap(attributes["maybe a map"])`

### IsMatch

`IsMatch(target, pattern)`
Expand All @@ -389,6 +408,22 @@ Examples:

- `IsMatch("string", ".*ring")`

### IsString

`IsString(value)`

The `IsString` Converter returns true if the given value is a string.

The `value` is either a path expression to a telemetry field to retrieve or a literal.

If `value` is a `string` or a `pcommon.ValueTypeStr` then returns `true`, otherwise returns `false`.

Examples:

- `IsString(body)`

- `IsString(attributes["maybe a string"])`

### Log

`Log(value)`
Expand Down

0 comments on commit 1102d76

Please sign in to comment.