Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cybersecurity: Analyze Packbeat flows #1066

Open
ybyzek opened this issue Feb 4, 2022 · 0 comments
Open

Cybersecurity: Analyze Packbeat flows #1066

ybyzek opened this issue Feb 4, 2022 · 0 comments
Labels
ksqlDB ksqlDB related recipe use case A tutorial with an extended business use case

Comments

@ybyzek
Copy link
Contributor

ybyzek commented Feb 4, 2022

Reference: https://maciejszymczyk.medium.com/ksqldb-real-time-sql-magic-in-the-cybersecurity-scenario-part-1-3232fa711442

Snippet:

CREATE TABLE packetbeat_flows_by_1m WITH (KEY_FORMAT='JSON') AS
    SELECT
    source -> ip as srcip,
    source -> port as srcport,
    destination -> ip as dstip,
    destination -> port as dstport,
    network -> transport,
    SUM(source -> packets) as source_packets,
    SUM(source -> bytes) as source_bytes,
    SUM(destination -> packets) as destination_packets,
    SUM(destination -> bytes) as destination_bytes,
    SUM(network -> packets) as network_packets,
    SUM(network -> bytes) as network_bytes,
    COUNT(*) as cnt
FROM packetbeat_flows
WINDOW TUMBLING (SIZE 1 MINUTE)
GROUP BY source->ip, source-> port, destination->ip, destination->port, network->transport
  EMIT CHANGES;
@ybyzek ybyzek added recipe ksqlDB ksqlDB related use case A tutorial with an extended business use case labels Feb 4, 2022
@ybyzek ybyzek changed the title Analyze Packbeat flows Cybersecurity: Analyze Packbeat flows Feb 4, 2022
@rspurgeon rspurgeon self-assigned this Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ksqlDB ksqlDB related recipe use case A tutorial with an extended business use case
Projects
None yet
Development

No branches or pull requests

2 participants