Skip to content

Commit

Permalink
chore(merge): fix merge conflicts with dev branch
Browse files Browse the repository at this point in the history
Signed-off-by: Frederico Araujo <[email protected]>
  • Loading branch information
araujof committed Sep 5, 2023
2 parents a223356 + 89bc902 commit 20dde65
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ jobs:
id: tag_name
shell: bash
run: |
GHREF=${GITHUB_REF#refs/tags/}; echo ::set-output name=current_version::${GHREF%-*}
echo ::set-output name=current_tag::${GITHUB_REF#refs/tags/}
GHREF=${GITHUB_REF#refs/tags/}; echo "CURRENT_VERSION=${GHREF%%-*}" >> $GITHUB_ENV
echo "CURRENT_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Build Release Assets
id: build_release_assets
shell: bash
Expand All @@ -184,14 +184,14 @@ jobs:
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.tag_name.outputs.current_version }}
version: ${{ env.CURRENT_VERSION }}
path: ./CHANGELOG.md
- name: Release
uses: softprops/action-gh-release@v1
with:
body: ${{ steps.changelog_reader.outputs.changes }}
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: contains(steps.tag_name.outputs.current_version, '-rc')
prerelease: ( contains(env.CURRENT_VERSION, '-rc') || contains(env.CURRENT_VERSION, '-alpha') || contains(env.CURRENT_VERSION, '-beta') )
draft: true
files: |
${{ steps.build_release_assets.outputs.deb }}
Expand Down
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
## [Unreleased]

## [0.5.1] - 2023-06-07

### Added

- Add multi-driver support

### Changed

- Bumped UBI version to 8.8-854
- Bump sf-apis to 0.5.1

### Fixed

- Fix off-by-1 JSON ports encoding
- Add correct formatting to mapPortList in JSON output

## [0.5.0] - 2022-10-17

### Added
Expand Down Expand Up @@ -169,7 +185,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

- First release of SysFlow Processor.

[Unreleased]: https://github.com/sysflow-telemetry/sf-processor/compare/0.5.0...HEAD
[Unreleased]: https://github.com/sysflow-telemetry/sf-processor/compare/0.5.1...HEAD
[0.5.1]: https://github.com/sysflow-telemetry/sf-processor/compare/0.5.0...0.5.1
[0.5.0]: https://github.com/sysflow-telemetry/sf-processor/compare/0.4.4...0.5.0
[0.4.4]: https://github.com/sysflow-telemetry/sf-processor/compare/0.4.3...0.4.4
[0.4.3]: https://github.com/sysflow-telemetry/sf-processor/compare/0.4.2...0.4.3
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Supported tags and respective `Dockerfile` links

- [`0.5.0`, `latest`](https://github.com/sysflow-telemetry/sf-processor/blob/0.5.0/Dockerfile), [`edge`](https://github.com/sysflow-telemetry/sf-processor/blob/master/Dockerfile), [`dev`](https://github.com/sysflow-telemetry/sf-processor/blob/dev/Dockerfile)
- [`0.5.1`, `latest`](https://github.com/sysflow-telemetry/sf-processor/blob/0.5.1/Dockerfile), [`edge`](https://github.com/sysflow-telemetry/sf-processor/blob/master/Dockerfile), [`dev`](https://github.com/sysflow-telemetry/sf-processor/blob/dev/Dockerfile)

# Quick reference

Expand All @@ -26,7 +26,7 @@
[docker hub](https://hub.docker.com/u/sysflowtelemetry) | [GHCR](https://github.com/orgs/sysflow-telemetry/packages)

- **Binary packages**:
[deb](https://github.com/sysflow-telemetry/sf-processor/releases/tag/0.5.0/sfprocessor-0.5.0-x86_64.deb) | [rpm](https://github.com/sysflow-telemetry/sf-processor/releases/tag/0.5.0/sfprocessor-0.5.0-x86_64.rpm) | [tgz](https://github.com/sysflow-telemetry/sf-processor/releases/tag/0.5.0/sfprocessor-0.5.0-x86_64.tar.gz)
[deb](https://github.com/sysflow-telemetry/sf-processor/releases/tag/0.5.1/sfprocessor-0.5.1-x86_64.deb) | [rpm](https://github.com/sysflow-telemetry/sf-processor/releases/tag/0.5.1/sfprocessor-0.5.1-x86_64.rpm) | [tgz](https://github.com/sysflow-telemetry/sf-processor/releases/tag/0.5.1/sfprocessor-0.5.1-x86_64.tar.gz)

# What is SysFlow?

Expand Down
8 changes: 7 additions & 1 deletion core/exporter/encoders/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,20 @@ func mapPortList(writer *jwriter.Writer, ports *[]*sfgo.Port) {
writer.RawString("ports")
writer.RawString(QUOTE_COLON)
writer.RawByte(BEGIN_SQUARE)
for _, p := range *ports {
for i, p := range *ports {
writer.RawByte(BEGIN_CURLY)
writeIntField(writer, "port", p.Port)
writer.RawByte(COMMA)
writeIntField(writer, "targetport", p.TargetPort)
writer.RawByte(COMMA)
writeIntField(writer, "nodeport", p.NodePort)
writer.RawByte(COMMA)
writeStrField(writer, "proto", p.Proto)
if (i + 1) < len(*ports) {
writer.RawString(END_CURLY_COMMA)
} else {
writer.RawByte(END_CURLY)
}
}
writer.RawByte(END_SQUARE)
}
Expand Down
1 change: 1 addition & 0 deletions core/exporter/encoders/jsonconstants.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const (
DOUBLE_QUOTE = '"'
QUOTE_COLON = "\":"
QUOTE_COLON_CURLY = "\":{"
BEGIN_CURLY = '{'
END_CURLY_COMMA = "},"
END_CURLY = '}'
END_SQUARE = ']'
Expand Down
7 changes: 7 additions & 0 deletions core/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,17 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
<<<<<<< HEAD
github.com/sysflow-telemetry/sf-apis/go v0.0.0-20230222025549-ace3972c88de h1:PQDrSt2ghjEd9CCIIHCOfGGRc/FolJDdefhtFhjYEKw=
github.com/sysflow-telemetry/sf-apis/go v0.0.0-20230222025549-ace3972c88de/go.mod h1:eo1ATE056Rqb9LhE4LA/0Y2AHfV//1zdCw0py4/S5HM=
github.com/sysflow-telemetry/sf-apis/go v0.0.0-20230905191833-17e4c751b04c h1:5BCJMIuiysHlYJe+nr/203cqIS6cpTIssbUD8v88VOU=
github.com/sysflow-telemetry/sf-apis/go v0.0.0-20230905191833-17e4c751b04c/go.mod h1:eo1ATE056Rqb9LhE4LA/0Y2AHfV//1zdCw0py4/S5HM=
=======
github.com/sysflow-telemetry/sf-apis/go v0.0.0-20220720151945-fca5a11be917 h1:8CcXMnjU5TxCXDRxRQnWvon3VsA47lVe4WaAuxBuJus=
github.com/sysflow-telemetry/sf-apis/go v0.0.0-20220720151945-fca5a11be917/go.mod h1:hK3FNloWIvlioheWODPJcA3TOxJbxMafoUezq3ZNCww=
github.com/sysflow-telemetry/sf-apis/go v0.0.0-20230404030540-37e5fa8614fc h1:3+lsQOjaTym5jHq3X2q/NwrCLVD0BHnNqfvR7mky44Y=
github.com/sysflow-telemetry/sf-apis/go v0.0.0-20230404030540-37e5fa8614fc/go.mod h1:hK3FNloWIvlioheWODPJcA3TOxJbxMafoUezq3ZNCww=
>>>>>>> dev
github.com/tidwall/gjson v1.14.1 h1:iymTbGkQBhveq21bEvAQ81I0LEBork8BFe1CUZXdyuo=
github.com/tidwall/gjson v1.14.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
Expand Down
6 changes: 3 additions & 3 deletions docs/CONFIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ If the _export_ parameter is set to `syslog`, output to syslog is enabled and th
- _syslog.tag_ (optional): The tag used for each Sysflow record in syslog. Default is `SysFlow`.
- _syslog.source_ (optional): If set adds a hostname to the syslog header.
- _syslog.host_ (optional): The hostname of the sysflow server. Default is `localhost`.
- _syslog.port_ (optional): The port pf the syslow server. Default is `514`.
- _syslog.port_ (optional): The port of the syslow server. Default is `514`.

#### ElasticSearch

Expand All @@ -117,7 +117,7 @@ Data export is done via bulk ingestion. The ingestion can be controlled by some
- _es.bulk.flashBuffer_ (optional): The size in bytes of the flush buffer for ingestion. It should be large enough to hold one bulk (the number of records specified in _buffer_), otherwise the bulk is broken into smaller chunks. Default is `5e+6`.
- _es.bulk.flushTimeout_ (optional): The flush buffer time threshold. Valid values are golang duration strings. Default is `30s`.

The Elastic exporter does not make any assumption on the existence or configuration of the index specified in _es.index_. If the index does not exist, Elastic will automatically create it and apply a default dynamic mapping. It may be beneficial to use an explicit mapping for the ECS data generated by the Elastic exporter. For convinience we provide an [explicit mapping](resources/mappings/ecs_mapping.json) for creating a new tailored index in Elastic. For more information refer to the [Elastic Mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html) reference.
The Elastic exporter does not make any assumption on the existence or configuration of the index specified in _es.index_. If the index does not exist, Elastic will automatically create it and apply a default dynamic mapping. It may be beneficial to use an explicit mapping for the ECS data generated by the Elastic exporter. For convinience we provide an [explicit mapping](https://github.com/sysflow-telemetry/sf-processor/blob/master/resources/mappings/ecs_mapping.json) for creating a new tailored index in Elastic. For more information refer to the [Elastic Mapping](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html) reference.

<!--
#### IBM Findings
Expand Down Expand Up @@ -188,4 +188,4 @@ The `flattener` handler has a built-in time decay filter that can be enabled to
"filter.enabled": "on|off (default: off)",
"filter.maxage": "time decay in minutes (default: 24H)"
}
```
```
2 changes: 1 addition & 1 deletion makefile.manifest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ SYSFLOW_VERSION?=0.6.0
SYSFLOW_BUILD_NUMBER?=1
SYSFLOW_JSON_SCHEMA_VERSION=5
SYSFLOW_ECS_VERSION=8.2
UBI_VERSION=8.6-943.1665521450
UBI_VERSION=8.8-854
2 changes: 1 addition & 1 deletion plugins/handlers/printer/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module github.com/sysflow-telemetry/sf-processor/plugins/handlers/printer

go 1.19

require github.com/sysflow-telemetry/sf-apis/go v0.0.0-20220720151945-fca5a11be917
require github.com/sysflow-telemetry/sf-apis/go v0.0.0-20230404030540-37e5fa8614fc

require (
github.com/actgardner/gogen-avro/v7 v7.3.1 // indirect
Expand Down
2 changes: 2 additions & 0 deletions plugins/handlers/printer/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/sysflow-telemetry/sf-apis/go v0.0.0-20220720151945-fca5a11be917 h1:8CcXMnjU5TxCXDRxRQnWvon3VsA47lVe4WaAuxBuJus=
github.com/sysflow-telemetry/sf-apis/go v0.0.0-20220720151945-fca5a11be917/go.mod h1:hK3FNloWIvlioheWODPJcA3TOxJbxMafoUezq3ZNCww=
github.com/sysflow-telemetry/sf-apis/go v0.0.0-20230404030540-37e5fa8614fc h1:3+lsQOjaTym5jHq3X2q/NwrCLVD0BHnNqfvR7mky44Y=
github.com/sysflow-telemetry/sf-apis/go v0.0.0-20230404030540-37e5fa8614fc/go.mod h1:hK3FNloWIvlioheWODPJcA3TOxJbxMafoUezq3ZNCww=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
16 changes: 16 additions & 0 deletions plugins/processors/example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (s *Example) Register(pc plugins.SFPluginCache) {

// Process implements the main interface of the plugin.
func (s *Example) Process(ch []interface{}, wg *sync.WaitGroup) {
<<<<<<< HEAD
for _, chi := range ch {
cha := chi.(plugins.Channel[*sfgo.FlatRecord])
record := cha.In
Expand All @@ -72,6 +73,21 @@ func (s *Example) Process(ch []interface{}, wg *sync.WaitGroup) {
if fc.Ints[sfgo.SYSFLOW_IDX][sfgo.SF_REC_TYPE] == sfgo.PROC_EVT {
logger.Info.Printf("Process Event: %s, %d", fc.Strs[sfgo.SYSFLOW_IDX][sfgo.PROC_EXE_STR], fc.Ints[sfgo.SYSFLOW_IDX][sfgo.EV_PROC_TID_INT])
}
=======
cha := ch[0].(*flattener.FlatChannel)
record := cha.In
logger.Trace.Println("Example channel capacity:", cap(record))
defer wg.Done()
logger.Trace.Println("Starting Example")
for {
fc, ok := <-record
if !ok {
logger.Trace.Println("Channel closed. Shutting down.")
break
}
if fc.Ints[sfgo.SYSFLOW_IDX][sfgo.SF_REC_TYPE] == sfgo.PROC_EVT {
logger.Info.Printf("Process Event: %s, %d", fc.Strs[sfgo.SYSFLOW_IDX][sfgo.PROC_EXE_STR], fc.Ints[sfgo.SYSFLOW_IDX][sfgo.EV_PROC_TID_INT])
>>>>>>> dev
}
}
logger.Trace.Println("Exiting Example")
Expand Down

0 comments on commit 20dde65

Please sign in to comment.