nsyslog
Version:
Modular new generation log agent. Reads, transform, aggregate, correlate and send logs from sources to destinations
97 lines (85 loc) • 2.08 kB
Markdown
Sets new properties to the input object. The object can be extended with these new properties, or it can be replaced by them.
```json
"processors": {
"totuple": {
"type": "properties",
"config": {
"extend": false,
"set": {
"tuple": ["${originalMessage}", "${timestamp}"],
"length": "${originalMessage.length}",
"extra": {
"type": "syslog",
"format": "BSD"
}
}
}
}
}
```
```json
{
"originalMessage": "This is a test message",
"timestamp": "2023-03-15T10:00:00Z"
}
```
```json
{
"tuple": ["This is a test message", "2023-03-15T10:00:00Z"],
"length": 21,
"extra": {
"type": "syslog",
"format": "BSD"
}
}
```
---
```json
"processors": {
"fromtuple": {
"type": "properties",
"config": {
"deep": true,
"extend": true,
"set": {
"count": "${tuple[0]}",
"tokens": "${tuple[1]}"
}
}
}
}
```
```json
{
"tuple": [5, ["token1", "token2"]],
"metadata": {
"source": "logfile"
}
}
```
```json
{
"tuple": [5, ["token1", "token2"]],
"metadata": {
"source": "logfile"
},
"count": 5,
"tokens": ["token1", "token2"]
}
```
---
* **set**: Object containing the new properties to set. These properties can be expressions evaluated dynamically.
* **extend**: (Default: `true`) When enabled, the input object will be extended with the generated properties. If disabled, the input object will be replaced with a new object containing only the generated properties.
* **deep**: (Default: `false`) When enabled and **extend** is `true`, the generated properties will be deeply merged into the input object if their destination already exists. Otherwise, the destination field will be replaced.
* **delete**: (Optional) List of fields to delete from the input object.