Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

sensor: Add a posssibility to output directly to plugins #28

Merged
vadorovsky merged 10 commits intomainfrom
sensor-plugin-output
Jun 2, 2022
Merged

sensor: Add a posssibility to output directly to plugins #28
vadorovsky merged 10 commits intomainfrom
sensor-plugin-output

Conversation

@vadorovsky
Copy link
Contributor

Before this change, using output plugins like S3 and Kafka was possible
only from receiver, which adds additional complexity for users
interested only in streaming packets directly to the external cloud
storage. Sensors always had to send packets to some receiver first.

This change makes it simplier by allowing to stream directly from
receiver to plugins.

Signed-off-by: Michal Rostecki [email protected]

}
select {
case output <- string(packetData[0:totalLen]):
case pluginChan <- string(packetData[:totalLen]):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for future: will be cleaner to have those channels inside a struct

@vadorovsky vadorovsky force-pushed the sensor-plugin-output branch 2 times, most recently from 4afa74d to a5e5390 Compare June 1, 2022 14:11
vadorovsky added 10 commits June 1, 2022 16:19
For now we are going to send uncompresseed packets to S3. Therefore
there is no need for TLV info.

Signed-off-by: Michal Rostecki <[email protected]>
Log the fact that a plugin is started.

Signed-off-by: Michal Rostecki <[email protected]>
Before this change, we were using some custom file header, not readable
by tcpdump or any pcap tool. This change replaces it with a correct pcap
header.

Signed-off-by: Michal Rostecki <[email protected]>
Before this change, breaking the output loop was ineffective.

Signed-off-by: Michal Rostecki <[email protected]>
Before this change, using output plugins like S3 and Kafka was possible
only from receiver, which adds additional complexity for users
interested only in streaming packets directly to the external cloud
storage. Sensors always had to send packets to some receiver first.

This change makes it simplier by allowing to stream directly from
receiver to plugins.

Signed-off-by: Michal Rostecki <[email protected]>
Before this change, PacketStreamer was always expecting some file
descriptor to be available. That was forcing users wanting to output
only to plugin(s) to configure a /dev/null file anyway. Then
PacketStreamer was performing a wasteful job of writing to /dev/null.

This change fixes that by allowing to configure only plugins and not
writing to fd when it's not present.

Signed-off-by: Michal Rostecki <[email protected]>
Signed-off-by: Michal Rostecki <[email protected]>
Signed-off-by: Michal Rostecki <[email protected]>
Using /dev/null file is not needed anymore.

Signed-off-by: Michal Rostecki <[email protected]>
@vadorovsky vadorovsky force-pushed the sensor-plugin-output branch from a5e5390 to e9dd214 Compare June 1, 2022 14:50
@noboruma noboruma self-requested a review June 2, 2022 04:06
@vadorovsky vadorovsky merged commit cbc3c1b into main Jun 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants