Skip to content

Commit

Permalink
Update docs and CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffail committed Aug 22, 2023
1 parent 17b0e20 commit 8d88531
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ All notable changes to this project will be documented in this file.

## Unreleased

## 4.20.0 - 2023-08-22

### Added

- The `amqp1` input now supports `anonymous` SASL authentication.
- New JWT Bloblang methods `parse_jwt_es256`, `parse_jwt_es384`, `parse_jwt_es512`, `parse_jwt_rs256`, `parse_jwt_rs384`, `parse_jwt_rs512`, `sign_jwt_es256`, `sign_jwt_es384` and `sign_jwt_es512` added.
- The `csv-safe` input codec now supports custom delimiters with the syntax `csv-safe:x`.
- The `open_telemetry_collector` tracer now supports secure connections, enabled via the `secure` field.
- Function `v0_msg_exists_meta` added to the `javascript` processor.

### Fixed

Expand Down
13 changes: 11 additions & 2 deletions internal/log/slog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ func TestSlogToBenthosLoggerAdapterMapKV(t *testing.T) {
logger.Warnln("Warning message foo fields")
logger.Warnf("Warning message root module\n")

expected := "time=\"\" level=WARN msg=\"Warning message foo fields\" foo=bar count=10 thing=\"is a string\" iscool=true\ntime=\"\" level=WARN msg=\"Warning message root module\\n\" foo=bar count=10 thing=\"is a string\" iscool=true\n"
assert.Equal(t, expected, buf.String())
bufStr := buf.String()

for _, exp := range []string{
"time=\"\" level=WARN msg=\"Warning message foo fields\"",
"foo=bar",
"count=10",
"thing=\"is a string\" iscool=true",
"time=\"\" level=WARN msg=\"Warning message root module\\n\"",
} {
assert.Contains(t, bufStr, exp)
}
}
14 changes: 14 additions & 0 deletions website/docs/components/processors/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,20 @@ Obtain the root of the processed message as a structured value. If the message i
let foo = benthos.v0_msg_as_structured().foo;
```

### `benthos.v0_msg_exists_meta`

Check that a metadata key exists.

#### Parameters

**`name`** <string> The metadata key to search for.

#### Examples

```javascript
if (benthos.v0_msg_exists_meta("kafka_key")) {}
```

### `benthos.v0_msg_get_meta`

Get the value of a metadata key from the processed message.
Expand Down

0 comments on commit 8d88531

Please sign in to comment.