Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
HeadHunter483 committed Aug 14, 2024
1 parent 9327088 commit 1f927ab
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 0 deletions.
44 changes: 44 additions & 0 deletions plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -852,6 +852,50 @@ pipelines:
## splunk
It sends events to splunk.

By default it only stores original event under the "event" key according to the Splunk output format.

If other fields are required it is possible to copy fields values from the original event to the other
fields relative to the output json. Copies are not allowed directly to the root of output event or
"event" field and any of its subfields.

For example, timestamps and service name can be copied to provide additional meta data to the Splunk:

```yaml
copy_fields:
ts: time
service: fields.service_name
```

Here the plugin will lookup for "ts" and "service" fields in the original event and if they are present
they will be copied to the output json starting on the same level as the "event" key. If the field is not
found in the original event plugin will not populate new field in output json.

In:

```json
{
"ts":"1723651045",
"service":"some-service",
"message":"something happened"
}
```

Out:

```json
{
"event": {
"ts":"1723651045",
"service":"some-service",
"message":"something happened"
},
"time": "1723651045",
"fields": {
"service_name": "some-service"
}
}
```

[More details...](plugin/output/splunk/README.md)
## stdout
It writes events to stdout(also known as console).
Expand Down
44 changes: 44 additions & 0 deletions plugin/output/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,50 @@ pipelines:
## splunk
It sends events to splunk.
By default it only stores original event under the "event" key according to the Splunk output format.
If other fields are required it is possible to copy fields values from the original event to the other
fields relative to the output json. Copies are not allowed directly to the root of output event or
"event" field and any of its subfields.
For example, timestamps and service name can be copied to provide additional meta data to the Splunk:
```yaml
copy_fields:
ts: time
service: fields.service_name
```
Here the plugin will lookup for "ts" and "service" fields in the original event and if they are present
they will be copied to the output json starting on the same level as the "event" key. If the field is not
found in the original event plugin will not populate new field in output json.
In:
```json
{
"ts":"1723651045",
"service":"some-service",
"message":"something happened"
}
```

Out:

```json
{
"event": {
"ts":"1723651045",
"service":"some-service",
"message":"something happened"
},
"time": "1723651045",
"fields": {
"service_name": "some-service"
}
}
```

[More details...](plugin/output/splunk/README.md)
## stdout
It writes events to stdout(also known as console).
Expand Down
54 changes: 54 additions & 0 deletions plugin/output/splunk/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,50 @@
# splunk HTTP Event Collector output
It sends events to splunk.

By default it only stores original event under the "event" key according to the Splunk output format.

If other fields are required it is possible to copy fields values from the original event to the other
fields relative to the output json. Copies are not allowed directly to the root of output event or
"event" field and any of its subfields.

For example, timestamps and service name can be copied to provide additional meta data to the Splunk:

```yaml
copy_fields:
ts: time
service: fields.service_name
```
Here the plugin will lookup for "ts" and "service" fields in the original event and if they are present
they will be copied to the output json starting on the same level as the "event" key. If the field is not
found in the original event plugin will not populate new field in output json.
In:
```json
{
"ts":"1723651045",
"service":"some-service",
"message":"something happened"
}
```

Out:

```json
{
"event": {
"ts":"1723651045",
"service":"some-service",
"message":"something happened"
},
"time": "1723651045",
"fields": {
"service_name": "some-service"
}
}
```

### Config params
**`endpoint`** *`string`* *`required`*

Expand Down Expand Up @@ -83,5 +127,15 @@ Multiplier for exponential increase of retention between retries

<br>

**`copy_fields`** *`map[string]string`*

Map of field paths copy from field in original event to field in output json.
To fields paths are relative to output json - one level higher since original
event is stored under the "event" key. Supports nested fields in both from and to.
Supports copying whole original event, but does not allow to copy directly to the output root
or the "event" key with any of its subkeys.

<br>


<br>*Generated using [__insane-doc__](https://github.com/vitkovskii/insane-doc)*

0 comments on commit 1f927ab

Please sign in to comment.